Logging data to SD Card - What is the best method?
Hugh
Posts: 362
Hi Folks,
I need to log some data that is encoded as 12V = 0, 0V = 1. The timings are 'variable' to say the least so I'd like to be able to cope with some of the faster transitions, though there's nothing the SD card shouldn't be able to handle.
I have the 12V input connected to a TLP-504A opto-isolator and via a repeat loop driving an LED I have verifed that the Prop is seeing the state correctly.
My first two thoughts were:
a) Write the value of the prop counter to the SD card every time the state changed - knowing the clock speed I can then read the data and work out what happened. This would involve writing quite a large number to the SD card quite often.
b) Write the value of the change in prop counter every time the state changed - this would involve writing a smaller number, but I'd have to deal with the roll-over of the counter
Any other thoughts or suggestions?
Thanks
Hugh
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
I need to log some data that is encoded as 12V = 0, 0V = 1. The timings are 'variable' to say the least so I'd like to be able to cope with some of the faster transitions, though there's nothing the SD card shouldn't be able to handle.
I have the 12V input connected to a TLP-504A opto-isolator and via a repeat loop driving an LED I have verifed that the Prop is seeing the state correctly.
My first two thoughts were:
a) Write the value of the prop counter to the SD card every time the state changed - knowing the clock speed I can then read the data and work out what happened. This would involve writing quite a large number to the SD card quite often.
b) Write the value of the change in prop counter every time the state changed - this would involve writing a smaller number, but I'd have to deal with the roll-over of the counter
Any other thoughts or suggestions?
Thanks
Hugh
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
Comments
Aha! I didn't know that - thanks. That makes all the difference!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.