Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

data logger code required .

Status
Not open for further replies.

rickomorley

Newbie level 2
Joined
Jul 7, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
17
hello

iam new to pic programming
My problem is the following:
I have a olimex web pic rev c board i have 3 analogue values working an2/an4/an10,
the pic is an 18f67j60

i require (c code) a method of storing these analogue values at say 100ms intervals for 10secs in to an area of the eeprom memory that rewrites itself , but importantly that i can retrieve via ethernet from the web page provided by olimex .


please any code examples or some one managed to do this ?

If you can give me any hints or suggest any other existing threads that would help with this, it would be much appreciated.
Thanks in advance.
 

Your basic steps would be the following:
1.) Setup your analog input ports and ADC parameters
2.) Cycle through the three channels with ADCON register
3.) Set the channel, read the ADC value, write to eeprom, update eeprom address, delay, go to the next channel
4.) The eeprom address you will have to increment and keep track of to know which has been used and where you are at in your data storage. There are a few C libraries based on your compiler that writes to eeprom easily.
 

thanks for info , iam able to setup a2d ok and this works as i can read values on the olimex web page for all 3 analogue inputs .

iam unsure how you then write these values to eeprom memory , any code examples ?
do u need to create a area to sort these values in ?
would a sd card be an easy option ?

regards
 

I can help you if you are using mikroC Compiler. 2 bytes are needed for each adc value. you need 200 bytes.
 

You have to check the datasheet to set what kind of data memory is available for storing the values. You would start with the start address of the memory and write each byte and increment the write counter. Then when you want to retrieve the data you would read all the values from the start address to the write counter. In Hi-Tech C there is a eeprom library that is very simple to use but I would have to look at compatibility to see if it would work for you.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top