We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: Petar Timotijević
Last Updated: 2013-07-02
Package Version: 1.0.0.0
Example: 1.0.0.0
Category: Measurement
Downloaded: 1552 times
Not followed.
License: MIT license
Log ADC Values when button is pressed in internal EEPROM
RD0 - Start Log
RD1 - Erase complete EEPROM
LCD shows current ADC steps and voltage in 0-5V range.
Each time when RD0 is pressed uC take 8 samples from ADC in intervals of 3sec and stop.
PortC LEDs shows progress of sampling each byte in EEPROM like bargraph.
Do you want to subscribe in order to receive notifications regarding "Log ADC Values when button is pressed in internal EEPROM" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Log ADC Values when button is pressed in internal EEPROM" changes.
Do you want to report abuse regarding "Log ADC Values when button is pressed in internal EEPROM".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1372730289_log_adc_values_w_mikroc_pic.rar [595.50KB] | mikroC PRO for PIC |
|
Log ADC Values when button is pressed in internal EEPROM
Development board system : EasyPIC7
Compiler : MikroC Pro for PIC 6.0.0
Microcontroller : PIC18F45K22 32MHz (can be any other similar)
PORT A - RA1 10-bit ADC Input
PORT B - LCD 2x16
PORT C - 8 LEDs
PORT D - RD0 Start Log, RD1 Erase all data in EEPROM
Each time when RD0 is pressed PIC get 8 samples from ADC in 3sec intervals and stops.
Current screenshot shows empty EEPROM. Last address in EEPROM holds address of next free memory slot for log. Currently on screenshot whole memory is empty. Some other uC such as PIC18F46K22 have 1024 bytes EEPROM.
View full imageSome logged samples in EEPROM. At 0xFF (last) address you can see value 40 (0x40). This means next free address for writing is 0x40. Current screenshot shows that we pressed 4 times RD0 button and we log 32 ADC steps values (each row 8 samples (16 bytes).
View full imageThere is no free space for new datas. PortC LEDs blinks several times and on LCD 'MemFull' note.
View full imageThere is no free space for new datas. PortC LEDs blinks several times and on LCD 'MemFull' note. Value 0xFE on 0xFF address tells that memory is full. Address 0xFE can be used together with 0xFF to support larger EEPROM size.
View full imageExamples of writing/reading data in EEPROM Two bytes are used for each sample. Examples: DEC 255 BIN 11111111 HEX FF (one byte) DEC 1023 BIN 11 11111111 HEX 03 FF (two bytes) DEC 512 BIN 10 00000000 HEX 02 00 (two bytes)
View full image