I just want to say hello since I’m new to PBP. I’m thinking to make Data Logger to log 4 batteries, 2 temperatures, frequency, and time 2% or less accuracy using 16k 18F4420 8mhz internal clock. I’ll be saving all the data in Flash. 100,000 life cycles is more than enough for my lifetime to use data logger. Before I start writing the program I’d like to consult with you guys what a proper way to do it. If you please can suggest anything, I'm all ears.
1) I have to write 32bytes in to Flash at a time. Let’s assume 8 adc at resolution 8bit samplings equal 8 bytes. Should I just make 32 variables each equal byte and take 4 samplings of 8adc channels and write all 32 variables at once to flash? Is it a proper way to do it? Let’s say I’ll be logging only 7adc channels and is it possible to use an Array of 32 bytes and once it is full or almost full it starts writing to flash automatically. Is there a sample code like that so I can get an idea to modify for my application?
2) I’d like to be able to log time as well. Data logger will be logging under 20 minutes at a time. Time should be 2% or less accurate. What would be the best way to make 20 minutes clock using hardware interrupt or software without external RTC IC? If I use 100hz interrupt, I’m afraid it’d conflict with data logging. If I just use software code then I would have to adjust the timing to compensate for ADC sampling, CCP sampling, flash writing, flash erasing and other calculation which is probably a big pain in the butt and I’m not proficient as well do that kind of calculations yet.
3) I’m going to import all the data to Excel and use charts. I found Parallax PLX-DAQ software but is there any better solution to do that? I’m going to use software rs232 command so I don’t have to use Max232 and make it simple. What’s the fastest baud rate I can use with 8mhz internal clock with a minimum error tolerance?
Thank you
Bookmarks