PDA

View Full Version : How to read stored data from MCU EEPROM into PC?



jellis00
- 3rd October 2009, 02:26
I have an application that uses an ultrasonic transceiver to measure distance to objects and outputs a pulse width representation of the range to my PIC microcontroller over a single pin PWM input. The microcontroller commands the transceiver to make 6 measurements and stores the 6 results in EEPROM, averages the 6 measurements, then stores the average into EEPROM, and deletes the 6 individual measurements to save EEPROM space.
This data logging occurs every night at midnight and accumulates 31 averages over a 31 day period in 31 EEPROM WORD addresses.
At the beginning of each month I need to connect a PC to the PIC microcontroller (via Hyperterminal??) to read all 31 averages into the PC for storage/analysis in an EXCEL spreadsheet.
My problem is I can't figure out how to use Hyperterminal to read the accumulated EEPROM data residing in the PIC mictrocontroller's internal EEPROM. Does anyone have any PC software to do this or suggestions how I should accomplish this??

mackrackit
- 3rd October 2009, 11:03
My problem is I can't figure out how to use Hyperterminal to read the accumulated EEPROM data residing in the PIC mictrocontroller's internal EEPROM. Does anyone have any PC software to do this or suggestions how I should accomplish this??
When the PIC reads the EEPROM and sends it out to the terminal format the string with a comma in it so the terminal displays

"VAR1,yourDATA1"
"VAR2,yourDATA2"
and so on....

Then either copy paste the terminal or save to a text file. Open the file in excel as a comma delimited.

Or are you looking for something more automatic?

ardhuru
- 3rd October 2009, 15:26
This is how I'd do it;

Say your variable is 'N'.

Put the line "DEBUG #N,13,10" in a loop.

When it stops, copy the output from Hyperteminal, and just paste it into Excel. All the data items should appear in the column you've pasted into.

Things become slightly more complex if you have more than one entry per record, to be pasted into 2 or more columns, but for single columns this should work fine.

Regards,

Anand