12 Inputs written to an EEPROM
sumguy16
Posts: 21
Aye-
I'm in the planning stage for a summer project. I want to read 12 different inputs and store the values in an EEPROM. I would like the resolution of the recording of the data to be in the area of 100Hz. This will require a large EEPROM I know, but that is not my problem. I am concerned that the BS2 will not be able to handle that much data processing. I won't be doing any calculation or modification of the input data, the microcontroller will simply be used as a device that can record a signal and store many times a second. Can the BS2 handle this or any of the STAMP microcontrollers for that matter? If not
A second problem I have is that I would like the time delay between the first input read and the last input read to be as short as possible ( < 10ms ).
Thanks for reading my post,
Adam
I'm in the planning stage for a summer project. I want to read 12 different inputs and store the values in an EEPROM. I would like the resolution of the recording of the data to be in the area of 100Hz. This will require a large EEPROM I know, but that is not my problem. I am concerned that the BS2 will not be able to handle that much data processing. I won't be doing any calculation or modification of the input data, the microcontroller will simply be used as a device that can record a signal and store many times a second. Can the BS2 handle this or any of the STAMP microcontrollers for that matter? If not
A second problem I have is that I would like the time delay between the first input read and the last input read to be as short as possible ( < 10ms ).
Thanks for reading my post,
Adam
Comments
··········· This is possible, like Paul stated with the Ins, or actually in this case you might want use the Inl for the lower byte and Inc for the upper nib this would make it easier to store to the variables. On the reading of the inputs you could be less then 10ms but the writing to the EEProm on some EEProms can take a few milliseconds.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Stephen Swanson
Technical Support
Parallax, Inc.
sswanson@parallax.com
Get_Inputs:
· status = INS & $0FFF
... where status is a Word variable.· The '&0FFF' masks out the unused pins in case you have additional control inputs that are not a part of what you want to store.· This also assumes that you inputs are active-high.· If they're active low, but you'd like to store an active state as a '1' you can do it like this:
Get_Inputs:
· status = ~INS & $0FFF
The tilde inverts the bits in the variable it's attached to.· Now that you have the bits, you want to WRITE them to the EEPROM.· With PBASIC 2.5 you can do it like this:
Save_Inputs:
· WRITE eePntr, Word status
· eePntr = eePntr + 2
The Word modifier in the WRITE instruction will put the inputs value into the EE, writing it low-byte, then high-byte.· Since you are writing two bytes, your pointer needs to be updated by two.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
I did not now about the masking on the fly
status = INS & $0FFF
I would have done
status = INS
status = INS & $0FFF
which obviously is not at clever....thanks