Shop OBEX P1 Docs P2 Docs Learn Events
Can you discuss to me about EEPROM of BASIC STAMP 2 - Page 2 — Parallax Forums

Can you discuss to me about EEPROM of BASIC STAMP 2

2»

Comments

  • OK sir. Maybe i can get what`s on you mind when i see your version of codes for that. Thanks :smile:
  • kwinn wrote: »
    by the way mr. Kwinn i just need a clear sample. Can u make me one? ignore the format of time that getting on GPS antenna. Just a clear sample and it may help me a lot. Thanks for the help :smile:

    I will see what I can do to help. Just keep in mind that I do not have a BS2 to test the code with.

    Its ok Mr. kwinn. Maybe i can understand the version of your codes once i see it. Thanks for helping me. I`ll wait for your sample codes Thanks :smile:

  • tomcrawfordtomcrawford Posts: 1,126
    edited 2016-10-19 15:37
    This thread shows how a vanilla BS-2 can get time from the GPS Parallax is currently selling.

    forums.parallax.com/discussion/164426/gps-clock-using-bs-2-and-pam-7q#latest

    Edit: With the engineering debug switch off, this takes 61% of a BS-2. That would leave room for about 200 four-byte time codes. And, of course, taking out the automatic daylight savings and/or day-of-week code, one could recover more. Endedit
  • kwinnkwinn Posts: 8,697
    @dontryme0300

    Better to start with the working code Tom Crawford was kind enough to post than some code I have no way of testing. It seems to have everything you will need for converting the time and date to a format you can use for your schedule portion of the code.
    This thread shows how a vanilla BS-2 can get time from the GPS Parallax is currently selling.

    forums.parallax.com/discussion/164426/gps-clock-using-bs-2-and-pam-7q#latest

    Edit: With the engineering debug switch off, this takes 61% of a BS-2. That would leave room for about 200 four-byte time codes. And, of course, taking out the automatic daylight savings and/or day-of-week code, one could recover more. Endedit

  • This thread shows how a vanilla BS-2 can get time from the GPS Parallax is currently selling.

    forums.parallax.com/discussion/164426/gps-clock-using-bs-2-and-pam-7q#latest

    Edit: With the engineering debug switch off, this takes 61% of a BS-2. That would leave room for about 200 four-byte time codes. And, of course, taking out the automatic daylight savings and/or day-of-week code, one could recover more. Endedit

    Hi Mr. TomCrawford. Right now i`m making a project so called Bell Ringer. You can set different time schedule on specific day then when that schedule meets the time of the gps, the bell will ring. Can you help me to make it? I highly appreciate if you will. Thanks in advance.
  • Need some details.
    1. What hardware do you have available? BS-2 vanilla or can you use BS-2 fancy?
    1b. What GPS?
    1c. How is your processor connected to the bell?
    1d. Do you have a computer to dedicate? How about a 2 x 16 serial LCD?
    2. Do you need to have different bells on each day of the week or just weekdays (Mon-Fri) vs. weekends?
    2b. How often do you need to change the daily bells? Do you need overrides?
    2c. Do you need different bells (say 1 second vs 2 or 3 second bells)?
  • ok Sir Tom.

    1. we have only the BS2 module

    1b. we are using Skylab GPS antenna and we`re getting the GPRMC/GNRMC data.

    1c. we are using ordinary bell that connected to socket of our device that giving 220v everytime the pin go high.

    2. Yes we need to put different time schedule on monday to sunday.

    2b. it depends to the user. because we create a vb program that u can set your desire time.

    2c. yes we need different bell.

    i`ll attach the pictures of my software that can set time and the device itself
  • Here is the sample print screens
    3104 x 1746 - 548K
    3104 x 1746 - 490K
    1920 x 1080 - 187K
  • we are using serial connector to connect the device to the computer so we can send the schedules that you set on the computer to the device.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Before I forget there are two applications on my website that store alarm times and test for them. One is a simple Digital Alarm Clock which has two user programmable alarms.

    http://savagecircuits.com/index.php/projects/basic-stamp-projects/25-digital-alarm-clocks

    The other is a Digital Thermostat which uses multiple times for various programs, not only for the HVAC but for the backlight schedule as well.

    http://savagecircuits.com/index.php/projects/basic-stamp-projects/22-digital-thermostat
  • dontryme,

    As I see it, you have three issues to deal with.

    1. Reading time and date from a GPS into a BS-2. You have to be able to configure the GPS to produce a ZDA sentence at no more than 4800 baud. It has to be 4800 baud because that is the fastest a BS-2 can read and format a serial string. It has to be a ZDA sentence because that is the only one small enough to fit into a BS-2. You can see how I did that for the module Parallax is currently selling at startGPS; I have no idea how to do it for your module (or that it is even possible).

    2. Deciding how to format the timecodes. In the file I am attaching, I used two bytes per entry. The first byte contains the hour in binary (0-23), along with two bits that enable this code for weekdays, weekends, or both. The second byte contains the minute in binary (0-59). I used binary rather than ascii because it is more compact and you have to have the values in binary anyway in order to convert UTC to your time zone. If you want to have them go by day (monday <> tuesday), you would add a third byte that had one bit for each day of the week to enabled that code for that day. This was shown earlier in the thread. That would free up two bits in the hour byte to allow for up to four different bell lengths.

    3. Getting the codes into the BS-2 (and this was your original question). You can either build them into the program as I did with a bunch of DATA statements, or you can download them from your VB program. To download, you will need a program in the BS-2 that accepts the codes from the VB program, converts them to whatever format you choose and writes them into the EEPROM where the bell program can find them. Have a look at the description of the DATA statement in the big yellow book where it talks about reserving EEPROM locations. To me, it would be a lot easier to just build them into the program.

    I have attached a program which you can use as an example. It has only one bell length and does not distinguish except for weekday and weekend. It also has the timecodes built into the program.

    tom crawford
  • Before I forget there are two applications on my website that store alarm times and test for them. One is a simple Digital Alarm Clock which has two user programmable alarms.

    http://savagecircuits.com/index.php/projects/basic-stamp-projects/25-digital-alarm-clocks

    The other is a Digital Thermostat which uses multiple times for various programs, not only for the HVAC but for the backlight schedule as well.

    http://savagecircuits.com/index.php/projects/basic-stamp-projects/22-digital-thermostat

    Thanks Mr. Savage. Ill study your work. Ill give you feedback after i studied it.
  • dontryme,

    As I see it, you have three issues to deal with.

    1. Reading time and date from a GPS into a BS-2. You have to be able to configure the GPS to produce a ZDA sentence at no more than 4800 baud. It has to be 4800 baud because that is the fastest a BS-2 can read and format a serial string. It has to be a ZDA sentence because that is the only one small enough to fit into a BS-2. You can see how I did that for the module Parallax is currently selling at startGPS; I have no idea how to do it for your module (or that it is even possible).

    2. Deciding how to format the timecodes. In the file I am attaching, I used two bytes per entry. The first byte contains the hour in binary (0-23), along with two bits that enable this code for weekdays, weekends, or both. The second byte contains the minute in binary (0-59). I used binary rather than ascii because it is more compact and you have to have the values in binary anyway in order to convert UTC to your time zone. If you want to have them go by day (monday <> tuesday), you would add a third byte that had one bit for each day of the week to enabled that code for that day. This was shown earlier in the thread. That would free up two bits in the hour byte to allow for up to four different bell lengths.

    3. Getting the codes into the BS-2 (and this was your original question). You can either build them into the program as I did with a bunch of DATA statements, or you can download them from your VB program. To download, you will need a program in the BS-2 that accepts the codes from the VB program, converts them to whatever format you choose and writes them into the EEPROM where the bell program can find them. Have a look at the description of the DATA statement in the big yellow book where it talks about reserving EEPROM locations. To me, it would be a lot easier to just build them into the program.

    I have attached a program which you can use as an example. It has only one bell length and does not distinguish except for weekday and weekend. It also has the timecodes built into the program.

    tom crawford


    Hello Mr. Crawford, Yes i need to use 4800 baud rate so that the string of GPS will not be garboiled. And the second one is my format would be 24hr format (HH:mm) only, we dont need the seconds. Thanks for helping me. Im looking forward that you will still continue to help me.
  • Here is a version that includes single day bells (not just MTWTF vs SS) and variable length bells. Still have to load the tomcods (that is what spell corrector insists on; who am I to argue?) into the program with DATA statements.
  • Hello Mr. Crawford. Thanks for helping me.. I`ll keep in touch to my project if i have more question or what would be the product of my project. :smile:
  • Guys Im Back.. I want to ask some help about reading and writing external eeprom. We decided that we will not use the eeprom of basic stamp on storing and reading schedules. Can u please guys help me?. my memory module is 24C1024.
  • The 24C1024 has an I2C interface. Since you are using a vanilla BS-2, you will have to bit-bang the protocol. This Nuts and Volts Volume contains an excellent discussion in Column 115. You will need to modify it to use a two-byte register address; I cannot remember whether the author specifically addressed that issue. Also, pay close attention to the part where he begs you to actually learn the protocol.
  • The 24C1024 has an I2C interface. Since you are using a vanilla BS-2, you will have to bit-bang the protocol. This Nuts and Volts Volume contains an excellent discussion in Column 115. You will need to modify it to use a two-byte register address; I cannot remember whether the author specifically addressed that issue. Also, pay close attention to the part where he begs you to actually learn the protocol.

    Sir Crawford i dont know if im using vanilla BS-2, all i know is im using a plain BS2.

  • @dontryme0300 'vanilla' means 'plain', just one of the confusing idioms of the American English language.

    What he meant to say was that the 'vanilla', 'plain', 'standard' BS2 does not support I2C with a build-in command (like serin...) as later versions of the BS can do, but you will need to talk to the EEPROM directly, toggling the pins where you connect the EEPROM to with some code you need to write, thus 'learn the protocol of I2C'.

    'Bit-banging' is some slang-word describing that your software will directly 'talk' to some external device by setting/reading pins WITHOUT any build-in function like serin/serout.

    Enjoy!

    Mike
  • dontryme0300dontryme0300 Posts: 44
    edited 2016-10-27 08:13
    Mr. Mike can i ask for your help? Can you give me a short sample of accessing, reading and writing 24c1024 on vanilla BS2? Thanks in Advance.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    I don't know if anyone will have an example that specific. I have attached an example of a BS2 talking to a 24LC128 EEPROM. You can use that code to help understand how to communicate with many I2C EEPROMs using the BS2.
  • I don't know if anyone will have an example that specific. I have attached an example of a BS2 talking to a 24LC128 EEPROM. You can use that code to help understand how to communicate with many I2C EEPROMs using the BS2.

    Thanks Sir. Savage, I will study it first.
  • dontryme0300dontryme0300 Posts: 44
    edited 2016-11-04 02:09
    Hi Guys im back, right now i cant make it. It so hard for me because its my first time writing on external/serial eeprom. Can u guys give me a super simple code on reading and writing on external/serial eeprom? Im using AT24C1024. Thanks guys. :depressed:
  • Guys can anyone give me a clear sample to read and write for AT24C1024? THanks in advance guys.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    In order to provide such a sample someone would have to have that EEPROM available. I know I don't have one. That is why I provided code for one that I do have. You may have to compare the differences in the way each EEPROM is accessed and make some changes to the code I provided you.
  • I`m getting a hard time with this project because i`m not knowledgeable in micro controllers. That`s why im here to ask for help. But thanks guys for your reply, suggestion and help. But until now, I dont have any progress to this project :(
Sign In or Register to comment.