Author |
Message |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Wed Feb 08, 2006 11:28 pm Subject: i2c and port b in 16f78 |
1. If you are reading other pins on Port B, which ones are they ?
2. Do you guarantee that there is no ICD2 or ICD or anything similar
plugged into your board ?
what i meant by saying ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Wed Feb 08, 2006 10:05 am Subject: i2c and port b in 16f78 |
There are two possibilities:
1. It could be some low-level problem with TRIS or a Read-Modify-Write
problem, that affects the hardware i2c port.
2. It could be a design error in your ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Wed Feb 08, 2006 9:57 am Subject: i2c and port b in 16f78 |
output_low_all();
if (INPUT(S8)==0) slave_buffer
if (!INPUT(S8)) slave_buffer[2]=88;
[/code]
thanks for correcting me, but it works if i read inputs from port A. it hangs only when i use ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Tue Feb 07, 2006 4:28 pm Subject: i2c and port b in 16f78 |
ooops, sorry about that.
here comes the program. This is the shortest i can give you, cause you need to know the i2c routine interrupts and anything shorter than this will not be much useful i guess. ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Tue Feb 07, 2006 4:07 pm Subject: i2c and port b in 16f78 |
1)thanks for the pointer, even some of port A pins take ANALOG inputs.
2)i2c bus is working fine when i use Port A pins as inputs, and it only hangs if i use any of the port B pins as inputs ( ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Tue Feb 07, 2006 3:52 pm Subject: i2c and port b in 16f78 |
Iam attaching what you asked for,
1)
#include <16F87.H>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP,NOMCLR
#use delay(clock = 20000000)
#use i2c(slave, sda=PIN_B1, scl=PIN_B4)
2) ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Tue Feb 07, 2006 2:12 pm Subject: Re: thanks |
[quote="karun211"][quote="PCM programmer"]1. Do you have a debugger (ICD2) connected to the PIC ?
2. Do you have NOLVP in your #fuses statement ?
If not, then add it.[/quote]
I tried it ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Mon Feb 06, 2006 11:06 pm Subject: thanks |
[quote="PCM programmer"]1. Do you have a debugger (ICD2) connected to the PIC ?
2. Do you have NOLVP in your #fuses statement ?
If not, then add it.[/quote]
i dont have a debugger connec ... |
Topic: i2c and port b in 16f78 |
karun211
Replies: 17
Views: 21943
|
Forum: General CCS C Discussion Posted: Mon Feb 06, 2006 8:34 pm Subject: i2c and port b in 16f78 |
Hi
It has been a wonderful experience using the CCSC compiler for my PIC projects . Thanks for the amazing compiler . Of late I have sort of run into a problem where in when the I2C communication ... |
|