View previous topic :: View next topic |
Author |
Message |
ice* Guest
|
93c46 initialising |
Posted: Wed Jun 08, 2005 6:16 am |
|
|
Im having this weird problem while interfacing with a
93C46C EEPROM....
whenevr i initialse the EEProm,by including the line " init_ext_eeprom()" ,the Do While loop containing the
"Read or Write" sentence,repeats itself three times..
If i comment out the line " init_ext_eeprom()",
the Do..While loop executes as it's supposed to..
I know the " init_ext_eeprom()" is executing well,because i monitored it using printf statements..
any help will be appreciated
Thankyou |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Wed Jun 08, 2005 9:10 am |
|
|
Different chips work different ways. Who's chip are you using? Is it in 8 or 16 bit mode. I think the drivers are only for 8 bit. Also can you post a small complete program. and let us know the compiler version. In general I use these for config of a FTDI chip in 16 bit mode... but I know a little about them. |
|
|
ice
Joined: 30 May 2005 Posts: 10 Location: India
|
|
Posted: Thu Jun 09, 2005 2:25 am |
|
|
Im using Microchip's EEProm..in the 8 bit mode meaning ive to tie it down to Vdd
Im using the CCS 9356spi.c example as a template:
i changed the driver file from 9356spi.c to 9346.c
Code: |
#include <input.c>
#include <9346.c>
|
No other changes were made _________________ **ice**
Machinegrid.com :: Robots at Work!! |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu Jun 09, 2005 10:49 am |
|
|
That sounds right to me. I'm sorry I'm of no help,... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 09, 2005 4:18 pm |
|
|
Quote: | whenevr i initialse the EEProm,by including the line "
init_ext_eeprom()" ,the Do While loop containing the
"Read or Write" sentence,repeats itself three times.. |
1. What PIC are you using ?
2. What PIC pins are you using for your RS232 ?
2. What PIC pins are you using for the EEPROM ?
3. Post your #fuses, #use delay(), and #use rs232() statements. |
|
|
ice
Joined: 30 May 2005 Posts: 10 Location: India
|
|
Posted: Thu Jun 09, 2005 10:52 pm |
|
|
treitmey,
Thanks for trying to help.
PCM programmer,
These are the pic details
Quote: | 1. What PIC are you using ? |
pic16f876a
Quote: | 2. What PIC pins are you using for your RS232 ? |
Hardware UART,pins 17 and 18..i use a bootloader from microchip c.
The uart works fine because ive used it for debugging my other projects
Quote: | 3. What PIC pins are you using for the EEPROM ?
|
portC
i made changes in the 9346 driver file
#define EEPROM_SELECT PIN_C7
#define EEPROM_CLK PIN_C6
#define EEPROM_DI PIN_C5
#define EEPROM_DO PIN_C4
Quote: | 3. Post your #fuses, #use delay(), and #use rs232() statements. |
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,stream=rxn ) // Set up TX RX pins
Regards. _________________ **ice**
Machinegrid.com :: Robots at Work!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 09, 2005 11:17 pm |
|
|
Quote: | 3. What PIC pins are you using for the EEPROM ?
portC
i made changes in the 9346 driver file
#define EEPROM_SELECT PIN_C7
#define EEPROM_CLK PIN_C6
#define EEPROM_DI PIN_C5
#define EEPROM_DO PIN_C4 |
You're already using pins C6 and C7 for the RS232.
You should change your pin assignments in the list
above, so that you don't use C6 and C7 for the EEPROM.
Then re-wire your board, and test it with the new code. |
|
|
ice
Joined: 30 May 2005 Posts: 10 Location: India
|
Ahhhhhhhh!! |
Posted: Fri Jun 10, 2005 12:34 am |
|
|
Ahhhhhhhhhhhhh!!!!! goddamit!!
i never even noticed it ,not even a teeny tiny bit...jst skipped my mind that the serial pins are being used[they run at the bottom of the board]....
uhhhh!.... anyway i love doing this...learnt something....to remember this step during debugging..
Thanks PCM Prog,its working now : ) _________________ **ice**
Machinegrid.com :: Robots at Work!! |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Fri Jun 10, 2005 10:13 am |
|
|
Interesting thing though, in a few months, down the road, you'll be doing something similar and start having the same problem and then start thinking to yourself "this seems sooooo familiar but I can't remember what the crap I did to make it work".
I can't say that I've EVER done anything like that though. |
|
|
|