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

93c46 initialising

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







93c46 initialising
PostPosted: Wed Jun 08, 2005 6:16 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Wed Jun 08, 2005 9:10 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu Jun 09, 2005 2:25 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu Jun 09, 2005 10:49 am     Reply with quote

That sounds right to me. I'm sorry I'm of no help,...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 09, 2005 4:18 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu Jun 09, 2005 10:52 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jun 09, 2005 11:17 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

Ahhhhhhhh!!
PostPosted: Fri Jun 10, 2005 12:34 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jun 10, 2005 10:13 am     Reply with quote

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". Twisted Evil

I can't say that I've EVER done anything like that though. Wink
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