CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

getenv("DATA_EEPROM") on 16F877A on PicDem2plus

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
custom_elect



Joined: 15 Dec 2007
Posts: 13

View user's profile Send private message

getenv("DATA_EEPROM") on 16F877A on PicDem2plus
PostPosted: Sat Dec 15, 2007 11:30 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Dec 15, 2007 12:32 pm     Reply with quote

I compiled the test program shown below with vs. 4.064 and ran it
in the MPLAB simulator. It displayed this result:
Quote:
256

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

View user's profile Send private message

PostPosted: Sat Dec 15, 2007 1:24 pm     Reply with quote

Many Thanks

I was using %d and only seeing 0 as the LSByte - Doh!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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