Problem with I2C2 on PIC24FJ32GA102

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
alexpisarev
Posts: 2
Joined: 22 Dec 2016 04:14

Problem with I2C2 on PIC24FJ32GA102

#1 Post by alexpisarev » 22 Dec 2016 04:27

Hi Everyone,

Witnessing a weird issue on PIC24FJ32GA102 when using I2C2.

TRISB.3 = 0
TRISB.2 = 0

I2C2_Init(100000)

I2C2_Start()
I2C2_Write (%01011010) 'General Call Address

[some other code]

It never returns from the Write call, so [some other code] never gets executed.

When re-writing the same piece of code with I2C1 (and after remapping the pins from SDA2/SCL2 (RB.2/RB.3) to SDA1/SCL1 (RB.8/RB.9) respectively), everything works just fine.

Is there anything else we should be looking at?

Thanks in advance.

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: Problem with I2C2 on PIC24FJ32GA102

#2 Post by uros.cvetinovic » 22 Dec 2016 13:20

Hi,

Do you have some slave on those I2C lines?

Please note that I2Cx_Write function is blocking function, and it will hang if you don't have any slave on used I2C lines.

Best regards,

Uros

alexpisarev
Posts: 2
Joined: 22 Dec 2016 04:14

Re: Problem with I2C2 on PIC24FJ32GA102

#3 Post by alexpisarev » 22 Dec 2016 17:12

Yes, slave is there and responds well when I switch to I2C1.

It is only I2C2 which is causing problem.

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: Problem with I2C2 on PIC24FJ32GA102

#4 Post by uros.cvetinovic » 23 Dec 2016 16:24

Hi,

Would it be a problem for you to submit a ticket on this subject and zip and send project that can reproduce this behavior.
http://helpdesk.mikroe.com/

We will help you out on this.

Best regards,

Uros

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”