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 support@ccsinfo.com

File EX_EXTEE.C not work.

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







File EX_EXTEE.C not work.
PostPosted: Wed Jun 28, 2006 1:23 am     Reply with quote

Hi all,

I'm use PIC16F877 control 24LC16B but it's not control plaese help me.

code
#if defined(__PCB__)
#include <16C56.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_A3, rcv=PIN_A2)

#elif defined(__PCM__)
#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

#elif defined(__PCH__)
#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#endif

#include <input.c>
#include <2416.c>


void main()
{

BYTE value, cmd;
EEPROM_ADDRESS address;

init_ext_eeprom();

do
{
do
{
printf("\r\nRead or Write: ");
cmd=getc();
cmd=toupper(cmd);
putc(cmd);
} while ( (cmd!='R') && (cmd!='W') );

printf("\n\rLocation: ");

#if sizeof(EEPROM_ADDRESS)==1
address = gethex();
#else
#if EEPROM_SIZE>0xfff
address = gethex();
#else
address = gethex1();
#endif
address = (address<<8)+gethex();
#endif

if(cmd=='R')
{
printf("\r\nValue: %X\r\n",READ_EXT_EEPROM( address ) );
printf("\r\nValue1 : %X , address : %X\r\n",value, address);

}
if(cmd=='W')
{
printf("\r\nNew value: ");
value = gethex();
printf("\n\r");
WRITE_EXT_EEPROM( address, value );
printf("\r\nValue : %X , address : %X\r\n",value, address);
printf("\r\nValue1: %X\r\n",READ_EXT_EEPROM( address ) );
}
}
while (TRUE);
}


Thank you very much.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 28, 2006 3:54 pm     Reply with quote

Download the PicDem2-Plus manual:
http://ww1.microchip.com/downloads/en/DeviceDoc/51275b.pdf
Look at page 19 (in the Acrobat reader). On the right side of the page,
it shows a schematic of a 24LC256 eeprom. You're using a 24LC16B,
but it has the same pinout, so the connections are the same.

1. Notice the schematic shows two 4.7K pull-up resistors.
Do you have those ?

2. Do you have all the connections to +5v and ground that
the schematic shows for the eeprom ?

3. The schematic shows the SCL pin on the eeprom goes to pin C3
on the PIC, and SDA goes to pin C4. The CCS 2416.c driver is
setup to use pins C3 and C4 on the PIC. Have you connected
your eeprom to those pins ?
rak
Guest







PostPosted: Wed Jun 28, 2006 8:19 pm     Reply with quote

hi PCM PROGRAMMER,
I'm have circuit follow it but not work. I'm used PROTEUS is simulator and it's not work.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 28, 2006 9:03 pm     Reply with quote

You're using a simulator and not a real PIC. I can't help anymore.
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