Author |
Message |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Wed Jul 07, 2021 2:49 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
OK. The problem was you referred to a slave address of 13, and this can't happen. The R/W bit is not actually part of the 'address'...
Anyway, going on to your code. The problem is how address==80 ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Wed Jul 07, 2021 2:00 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Regarding the R/W bit, you're not doing it correctly. Look at the
sample code in the link below. Look at the section where it reads
from the slave board. See how it does it:
http://www.ccsinfo. ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Wed Jul 07, 2021 12:18 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
You said
But if I change it to 0x13(00010011)
Slave addresses can _only_ be even numbers. They cannot be odd numbers.
A slave set with an address of 0x12, responds to address bytes of both 0x ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Tue Jul 06, 2021 11:14 pm Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Slave addresses are required to be even. Cannot be odd.
Hi Ttelmah,
What did you mean? I dont understand. |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Tue Jul 06, 2021 4:27 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
When I write 0xa1 to the first write command on the master, the data is not transmitted. Why?
Do you have pull-up resistors on SDA and SCL ? You need them.
For a 5v system, you can use 4.7K pullu ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Mon Jul 05, 2021 6:16 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Now, I need to send data from slave to master. Any tips you want to give like this? I haven't tried it yet, I can try and consult you again if I fail.
Actually, I have a question. In my code, slave ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Mon Jul 05, 2021 4:33 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
On the delay, you need some form of pause in the main loop after
sending the stop. Now honestly, much better for this to be quite long, like
100mSec, since then when the code works, you have a chanc ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Sun Jul 04, 2021 11:40 pm Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Hi Ttelmah,
You are setting the I2C pins and the output LED as analog.
The instruction needs to be used as I posted it, setting _none_ of the
pins as analog. On both chips.
Then this chip is ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Fri Jul 02, 2021 8:28 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Have you checked both chips are actually running?. Flash an LED on both.
As I said, you need to check this first.
#INT_SSP
void ssp_interupt ()
{
byte itemp;
temp=i2c_isr_ ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Fri Jul 02, 2021 7:40 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Hi Ttelmah,
First thing. This is a PPS chip. Currently the compiler will be setting up
software I2C for the master. Software will work for a master, but not for
a slave. Ideally use pin_select ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Fri Jul 02, 2021 7:06 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
I don't see PPS lines in the master code but I do in the slave.
Since they are the same chip both need PPS lines
Hello,
I updated the code as below. The problem is still the same.
#include ... |
Topic: PIC16F18346 to PIC16F18346 I2C Communication |
L.T.
Replies: 22
Views: 63559
|
Forum: General CCS C Discussion Posted: Fri Jul 02, 2021 5:39 am Subject: PIC16F18346 to PIC16F18346 I2C Communication |
Hello,
I am working on a code. I need to communicate 2 PIC16F18346 microcontrollers with I2C. I coded the C3 pin to be SCL and the C4 pin to be SDA and set up my circuit. It is connected to a 3.3V ... |
Topic: Can't read data with SPI using PIC16f18346 |
L.T.
Replies: 103
Views: 176762
|
Forum: General CCS C Discussion Posted: Tue Sep 01, 2020 11:44 pm Subject: Can't read data with SPI using PIC16f18346 |
If there's only ONE register that doesn't store data correctly, create/compile/post a small program that this happens.
If it's say 'register 0x13' then only write/read that register.
Post your code ... |
Topic: Can't read data with SPI using PIC16f18346 |
L.T.
Replies: 103
Views: 176762
|
Forum: General CCS C Discussion Posted: Tue Sep 01, 2020 8:36 am Subject: Can't read data with SPI using PIC16f18346 |
I have a trouble about CCS C Compiler!!
I described pgau12 array as GLOBAL REGISTER. I debugged the data, I looked to watch screen and I dont like I saw. It didn't write values in register and when ... |
Topic: Can't read data with SPI using PIC16f18346 |
L.T.
Replies: 103
Views: 176762
|
Forum: General CCS C Discussion Posted: Thu Aug 27, 2020 11:42 pm Subject: Can't read data with SPI using PIC16f18346 |
Because the data sent by the PGA is not true. It must change according with distance but it is sending same signal. When I set CKE and CKP as 0, then the data sent by the PIC is regular and the data s ... |
|