MPR084 and QE32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPR084 and QE32

2,049 Views
Juls
Contributor III

Hi

I did implement i2c communication from AN2318

But when I try to transmit the address I wait until busy flag get clear

and its never happening :smileyfrustrated:

got a 10K on SCL and SDA

both are at 3.3V

trap in the loop waiting busy to get clear

 

any idea?

Labels (1)
0 Kudos
Reply
8 Replies

1,352 Views
Juls
Contributor III

yes using pta2 and pta3

both 10k pullup

0 Kudos
Reply

1,352 Views
Juls
Contributor III

ok I removed the waiting loop for busy to see what would happen and as soon I try to do a start I get the interuption and then first thing I compare IIC_MST to see if im master and it return im the slave :smileyfrustrated: ive included my code

0 Kudos
Reply

1,352 Views
Juls
Contributor III

Hi again

the mpr084 seem to hold the SDA line at 0 when I boot

if I unsolder it get try state and I can resolder

the cpu stop seeing busy flags

 

but atm I set MST (master should create a start condition)


And I get interrupted immediatly by the i2c

if I run instead of debug I get a SLC 0 then 1  and nothing more SDA never moved

There is something I havent understand??

Didn t connect IRQ line

ATTN is set at 1 at boot and at 0 after a short moment

 

0 Kudos
Reply

1,352 Views
Juls
Contributor III

ok gone a little further

connected a DS3232

my clock was too fast first of all

now 50Khz

As also using wrong address for MPR084

but when I use debugger to step into the IIC interrupt I do get weird stuff

it check for RXAK everything is fine (also on scope the address is correct with R/W to 0) followed by a 0 at the 9th clock (ACK)

then compare cMasterRxFlag to see if we write or read from IIC and suddenly jump to line 285 and CLEAR IIC_TX bit

then weird thing happen on scope like clock of SCL and FF as data on SDA

 

any one seen this before?

0 Kudos
Reply

1,352 Views
Juls
Contributor III

Hi again

writing to MPR084 work correctly atm

 

but I fail at reading (well I read only 1 data then the I2C get jammed

 

to read from the MPR084 I send the slave address with r/w bit set at 1 right?

then read the byte comming (from what I understand this should read the register where the internal pointer is pointing)

then a stop condition exact?

 

 

or I have to write addr with | 0x01 then write a command byte then read the following byte?

or I have to do a repeated start somewhere in the process?

 

Atm I see the addr getting transmit with r/w at 1, then the value im expecting (0x40) from the fifo after a reset, then a ack (not sure who made it) then SCL going high (then expect SDA to go high for the STOP) but stay and remain low ....

 

Any one see my error in using the protocol

 

Thank you

 

ive attached the result SCL in yellow

0 Kudos
Reply

1,352 Views
Juls
Contributor III

I also have a DS3232 connected to this I2C

for this one the reading protocol is much more clear

to read the master ack each data and do a nack for the last byte it want to read

same thing for MPR084?

0 Kudos
Reply

1,352 Views
Juls
Contributor III

Indeed

(in case someone read)

 

set TXAK to 0 will not send a ask after receiving the first byte

allowing to create a stop

if you want to receive more than 1 set it to 1 then at 0 when expecting last byte

0 Kudos
Reply

1,352 Views
kef
Specialist I

Is IIC pins select bit (IICPS) set up properly?

0 Kudos
Reply