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

General Help

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



Joined: 13 Nov 2007
Posts: 2

View user's profile Send private message

General Help
PostPosted: Wed Nov 14, 2007 3:38 pm     Reply with quote

Hello all,

I started working on a project that is using Microchips's PIC18F2455 and 24LC64 EEPROM. I've read the tech docs, browsed around MicrochipC.com and set up my circuit. However, I'm new to coding PICs using C and I was wondering if anyone could point out a good tutorial or sample code that sets up a basic interaction between a PIC and an EEPROM. For example, the PIC stores a bit sequence to the EEPROM and then wait a little then reads the sequence back and displays it using LEDs.

Any advice is appreciated.

Thanks,
JV
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Nov 14, 2007 3:49 pm     Reply with quote

A good thing the CCS compiler comes with loads of examples and drivers.
Have a look at EX_EXTEE.c in the c:\program files\PICC\examples
With this example you can connect your PIC to a terminal program on your PC (Hyperterm for example) and then use the Read or Write commands to send to / read from the EEPROM.

Don't forget to change the include of 2416.c to 2464.c for your EEPROM.
JackVandaL



Joined: 13 Nov 2007
Posts: 2

View user's profile Send private message

PostPosted: Wed Nov 14, 2007 4:30 pm     Reply with quote

Thanks I looked over it, but when I say new I mean COMPLETELY new. Is there anything else like a tutorial that kind of walks through everything. Maybe it would help if I could look at the 2464.c code. Where is that located?

Also I guess I need to change 16F84.H to something else?

What does this do:

#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_A3, rcv=PIN_A2)

Sorry if this is all dumb questions
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 14, 2007 4:38 pm     Reply with quote

See this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=31628&highlight=24lc64&start=1
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Nov 15, 2007 10:28 am     Reply with quote

If you're brand spanking new to PIC's then I would suggest you start with something extremely basic. I remember when I first started, I had to learn things all over again. I was used to the 80C51 series and needed to learn the little 'quirks' of the PIC.

I would suggest you write a little program that simply blinks an LED that is tied to one pin. Play with the delays to adjust the timing. Then, I would suggest you switch to using one of the timers to control the blink rate. After that, you might want to interface the PIC with a PC and try sending data to/from the PIC. Once you get this running then you could start playing with the eeprom. Having a connection to a PC will enable you to store data to the eeprom and then read it back. The PIC can then send the data that was received to the PC for verification.

Take whatever steps you want but I would suggest you start out with the most simplest test that you can and build on that. We've all been there so don't worry about asking 'stupid' questions. The only stupid question is the one that isn't asked. If you want to learn there are a lot of good knowledgable people here willing to help.

As for your current questions, #use delay() tells the compiler what speed your crystal or internal oscillator is running at. This helps it put the correct code in to give accurate timing for delay commands and also sets up the serial port timing.

#use rs232 tells the compiler what speed the serial port will run at and what pins to use for RXD and TXD. This also has other options available that can be added, depending on what you need.

Ronald
When the remote control batteries begin to die, why do we try pushing harder on the buttons?
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Nov 15, 2007 1:03 pm     Reply with quote

Quote:

When the remote control batteries begin to die, why do we try pushing harder on the buttons?

Ehh..?? are you sure? pls dont´t tell me that IR beam intensity do not increase pushing
the buttons harder!! Shocked

Humberto
Nice comment Ronald Very Happy
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