• AVR Freaks

I2C compiles OK for 16F18323; errors with 16F18326

Author
KMCCAVIT
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/09/13 11:21:59
  • Location: 0
  • Status: offline
2019/11/19 15:16:27 (permalink)
0

I2C compiles OK for 16F18323; errors with 16F18326

I have I2C code that compiles without errors when I select a 16F18323 but generates error messages when I select an 16F18325 or 16F18326.  The error messages say I have undeclared identifiers 'SEN', 'PEN', 'RCEN', 'ACKDT', 'ACKEN'.  This makes sense since the 325 and 326 have dual I2C modules.  For instance, there is a SEN bit in both SSP1CON2 and SSP2CON2, so SEN is not a unique identifier.  So, my question is; is there a unique identifier for the SEN bit in SSP1CON2 that I can use to set the bit as in the code below for the 323 part?
 
/*Start Condition*/
void I2C_Master_Start()
{
  I2C_Master_Wait();    
  SEN = 1;             //Initiate start condition
}
#1

2 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: I2C compiles OK for 16F18323; errors with 16F18326 2019/11/19 15:54:20 (permalink)
    +2 (2)
    SSP2CON2bits.SEN = 1;
     
    For your own convenience, you could add your own defines. e.g.
    #define SEN1 SSP1CON2bits.SEN
    #define SEN2 SSP2CON2bits.SEN

     
     
    post edited by ric - 2019/11/19 15:59:31

    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
    till
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/11/12 19:12:45
    • Location: 0
    • Status: offline
    Re: I2C compiles OK for 16F18323; errors with 16F18326 2019/11/19 20:57:22 (permalink)
    0
    grin: grin
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5