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.

Writing & Reading EEPROM: Whats wrong with these stateme

Status
Not open for further replies.

aghazi

Junior Member level 2
Joined
Jan 23, 2006
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,551
'PICBASIC PRO CODE

myvar var byte

eeprom 0,[22] 'Storing 22 at location 0 in eeprom
Read 0, myvar 'Get data from EEprom address 0

lcdout "Value : ", DEC myvar ' display data on lcd

Using PIC Simulator IDE, The result i am getting is

Value : 1

Using EEPROM Memory Editor i can confirm that data is indeed there in EEPROM.

whats wrong? Thanks in advance for helping me out.

Regards,
AG
 

mnkeis

Newbie level 6
Joined
Feb 10, 2006
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Argentina
Activity points
1,418
Re: Writing & Reading EEPROM: Whats wrong with these sta

Do you have an assembler output from the compiler?
It will be more useful for debuging than basic code.

Regards

Mauro Casse
 

aghazi

Junior Member level 2
Joined
Jan 23, 2006
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,551
Re: Writing & Reading EEPROM: Whats wrong with these sta

OH MAN! How stupid am I? Just when i was replying the post with ASM file, I found my mistake. I was compiling the code for 16F877 but using the 16F84A in PIC Simulator IDE that why it was giving me wrong result from EEPROM.

Anyway thanks for the reply. Another lesson learned in this new world of µcontroller!

Regards,
AG
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top