|
|
View previous topic :: View next topic |
Author |
Message |
rak Guest
|
File EX_EXTEE.C not work. |
Posted: Wed Jun 28, 2006 1:23 am |
|
|
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
|
|
Posted: Wed Jun 28, 2006 3:54 pm |
|
|
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
|
|
Posted: Wed Jun 28, 2006 8:19 pm |
|
|
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
|
|
Posted: Wed Jun 28, 2006 9:03 pm |
|
|
You're using a simulator and not a real PIC. I can't help anymore. |
|
|
|
|
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
|