View previous topic :: View next topic |
Author |
Message |
custom_elect
Joined: 15 Dec 2007 Posts: 13
|
getenv("DATA_EEPROM") on 16F877A on PicDem2plus |
Posted: Sat Dec 15, 2007 11:30 am |
|
|
This function is returning 0 but there are supposed to be 256 bytes onboard this device.
Any Ideas?
Also how do you tell the difference between a 0 returned because getenv doesnt recognise the keyword, and 0 bytes?
Input gratefully received.
RB |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Dec 15, 2007 12:32 pm |
|
|
I compiled the test program shown below with vs. 4.064 and ran it
in the MPLAB simulator. It displayed this result:
Code: |
#include <16F877A.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
//===================================
void main()
{
int16 result;
result = getenv("DATA_EEPROM");
printf("%lu\n", result);
while(1);
}
|
|
|
|
custom_elect
Joined: 15 Dec 2007 Posts: 13
|
|
Posted: Sat Dec 15, 2007 1:24 pm |
|
|
Many Thanks
I was using %d and only seeing 0 as the LSByte - Doh! |
|
|
|