• AVR Freaks

Slave I2C2 Event Interrupt Flag Status bit not reading on 24EP256GP202

Author
allenhuffman
New Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2019/10/08 12:22:42
  • Location: Des Moines, Iowa, USA
  • Status: offline
2019/11/11 14:19:55 (permalink)
0

Slave I2C2 Event Interrupt Flag Status bit not reading on 24EP256GP202

I have been working on some polled I2C code (no interrupts) for a few PIC24 chips. I have working common code that runs on a few boards based on 24FJ256GA106 and 24FJ64GA002 PIC chips.
 
However, the same code, adjusted for the two GAEP256GP202-based boards I have do not work. I have been looking at the SFR registers in a debugger and never see the IFSx registers toggle any bits when I2C data comes in. (SI2C1IF, specifically).
 
 
The datasheet for this chip is different than the others, containing crowded tables for several PIC types, rather than broken-out pages for these registers. Using the info from there, I am using:
 
IFS1 bit 0 (SI2C1IF) for the incoming I2C data. I never see IFS1 or IFS3 (S12C2) change.
 
I assume there is some extra init step for this variation of PIC that I need, which the others do not.
 
Anyone familiar with this part?

Allen C. Huffman, Sub-Etha Software (est. 1990) www.subethasoftware.com
Embedded C, Arduino, ESP8266/32, BASIC Stamp and PIC programmer.
#1

2 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24540
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Slave I2C2 Event Interrupt Flag Status bit not reading on 24EP256GP202 2019/11/11 14:45:32 (permalink)
    0
    The most common problem is an analog capable pin that has not been switched to digital mode.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    allenhuffman
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2019/10/08 12:22:42
    • Location: Des Moines, Iowa, USA
    • Status: offline
    Re: Slave I2C2 Event Interrupt Flag Status bit not reading on 24EP256GP202 2019/11/11 14:51:48 (permalink)
    4 (1)
    Thanks! That sent me back to some existing code I was basing mine on to inspect the setup. I found that this particular board uses Alternate I2C1. I just needed to add "#FUSES ALTI2C1" to switch that over. I love it when it's something simple! (At least I learned a lot by reading through datasheets today.)

    Allen C. Huffman, Sub-Etha Software (est. 1990) www.subethasoftware.com
    Embedded C, Arduino, ESP8266/32, BASIC Stamp and PIC programmer.
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5