PIC to PIC over I2C – Default Examples

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC to PIC over I2C – Default Examples

Post by LeighM »

Hi Matt,
I2C routines in FC are stable to use as long as they are based on hardware?
Yes
And therefore can be used across all owned chip pack devises where applicable?
Only AVR and PIC 8/16/32 at present
Secondly, did you ever sort out an interrupt based routine as mentioned in your last post here
Sorry, it's looking non-trivial, so don't have time at the moment :(

Leigh

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: PIC to PIC over I2C – Default Examples

Post by Docara »

Hi Leigh,

So I'm guessing timer interrupt to pole the hardware receive register would be the preferred way to go then? Or would an Interrupt on Pin Change Interrupt would be an alternative?

Thanks
Matt

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC to PIC over I2C – Default Examples

Post by LeighM »

Yes, of those options, it would likely be best to call the cal_i2c::Slave_Status() on a timer interrupt.
Another option would be to have a short/fast main loop and poll, then take action based on status (aka state machine), depending of course on what else is being processed.

Post Reply