|
|
View previous topic :: View next topic |
Author |
Message |
STIX
Joined: 17 Jun 2006 Posts: 12
|
Project Design |
Posted: Wed Jun 28, 2006 9:10 am |
|
|
I'm designing a project that uses a PIC16F877A MCU. However, there are several steps in the project which I'm not sure on how to implement. I hope someone can point me in the right direction. The steps are as follows:
1) Record temperature sensor readings using the ADC on the MCU and store them in EEPROM (I think I can write a program to do this).
2) Upload the data from the EEPROM to a PC (How do I accomplish this and what type of hardware do I need)?
3) Process the data in the PC and get some results.
4) The results are to be stored in EEPROM and downloaded to the MCU again (Now, this means I have to write another program and downloaded onto the MCU. But I don't want to erase the existing program that I have on the MCU that records the temperature readings. So how do I get the information to the EEPROM again)?
Thanks in advance. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Wed Jun 28, 2006 9:28 am |
|
|
Your question isn't simple. In fact, it's about the same as someone asking "how do I build a car?"
You can easily create one program to do everything you need. When a certain button is pressed, or if the micro doesn't receive a command from a PC for a certain length of time, "record" mode is selected. In record mode, it measures temperature and saves this data to an external EEPROM.
When the micro is connected to a PC (serial RS232 connection is simplest), you can set up to code to start downloading data to the PC when the PC sends the download command to the micro. Or you can trigger a data download by pressing a different button.
When the PC is ready to upload the modified data to the micro, the whole process can be accomplished using the RS232 link again. However, this time the process revolves on a certain keyword(s) being sent from the PC to the micro. Perhaps "DATA ADDR 0C9A (data follows here)". The "DATA" tells the micro to expect some data to store to the external EEPROM, "ADDR 0C9A" tells it what starting address within the EEPROM, and the actual data to be stored then follows.
Find code examples of writing/reading to an external EEPROM, and also look up the interrupt driven serial routine example that comes with the compiler. It is called "ex_sisr.c" and it is found in the /examples directory of the CCS installation.
There are dozens if not hundreds of ways of coding this particular application. Just start small, build and test small blocks of code, then integrate the small blocks to form the program. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 28, 2006 3:11 pm |
|
|
The device you want to build is called a Data Logger.
To find sample projects on the net, use this search string:
"data logger" PIC |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|