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 CCS Technical Support

use i2c question!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
domdom



Joined: 06 Sep 2006
Posts: 29

View user's profile Send private message

PostPosted: Sat Mar 24, 2007 11:43 pm     Reply with quote

Hi PCM programmer,

Did you see the url? what is my problem for my window terminal?

Or may be the code is not working?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 24, 2007 11:59 pm     Reply with quote

You have a problem with sending serial data to Hyperterminal.
Even if the i2c code produces bad output, you should still see
the text in this printf statement:
Code:
printf("read %c \n\r", data);

You should see the word "read" in the Hyperterminal window.
I don't see it.

Try this very simple program, just to test if you can talk to PIC
by typing characters into the HyperTerminal window:
http://www.ccsinfo.com/forum/viewtopic.php?t=29538&start=6

Modify the PIC #include file and #use delay() statement
as required to fit your actual hardware.
You shoul be able to type characters and have the PIC send
them back to HyperTerminal, where they are displayed.
funmix



Joined: 27 Mar 2007
Posts: 33

View user's profile Send private message

PostPosted: Sat Mar 31, 2007 11:06 am     Reply with quote

Hi PCM programmer,

the example you use for master i2c is 16f877a, i changed the 16877A to 18f4520. It doesn't work.

Is there any errata for this chip?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 31, 2007 12:24 pm     Reply with quote

There are many i2c erratas on the A1 silicon of the 18F4520.
http://ww1.microchip.com/downloads/en/DeviceDoc/80209f.pdf

This page says there are three revisions: A1, B2, and B3.
http://www.microchip.com/stellent/idcplgidcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en010297

To find the silicon revision of your PIC, connect it to an ICD2 and
then select "Connect" from the Programmer menu in MPLAB.
It will display the revision. That's for Microchip tools. The CCS
tools probably also do it.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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