How to add missing sfr names?

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
calixarene
Posts: 17
Joined: 03 Apr 2012 06:31

How to add missing sfr names?

#1 Post by calixarene » 13 Mar 2015 08:22

I cannot find some sfr names for PIC32MX320 when using code assistance. Is it possible to add them?

For example

I2COV_I2C2STAT_bit <---- can be found
PEN_I2C2CON_bit <---- can be found


I2COV_I2C1STAT_bit <---- cannot be found
PEN_I2C1CON_bit <---- cannot be found

I can only found PEN_bit or I2COV_bit. All I want is to check whether there is an overflow of the I2C buffer and clear it. Set the Stop bit for I2C communication in I2C1 module in case there is an error.

Does I2C2CON.PEN_bit means the same as PEN_I2C2CON_bit?

User avatar
Aleksandar.Mitrovic
mikroElektronika team
Posts: 1697
Joined: 11 Mar 2015 12:48

Re: How to add missing sfr names?

#2 Post by Aleksandar.Mitrovic » 13 Mar 2015 17:49

Hi,

Thank you for your observations. We will investigate a little bit further this behavior and let you know the results soon.

Best regards,
Aleksandar

User avatar
Aleksandar.Mitrovic
mikroElektronika team
Posts: 1697
Joined: 11 Mar 2015 12:48

Re: How to add missing sfr names?

#3 Post by Aleksandar.Mitrovic » 16 Mar 2015 15:05

Hello,

I investigate you problem and find that bits in I2C1CON is defined as following:

Code: Select all

 // I2C1CON bits
    sbit  ON__I2C1CON_bit at I2C1CON.B15;
    sbit  SIDL_I2C1CON_bit at I2C1CON.B13;
    const register unsigned short int SCLREL = 12;
    sbit  SCLREL_bit at I2C1CON.B12;
    const register unsigned short int STRICT = 11;
    sbit  STRICT_bit at I2C1CON.B11;
    const register unsigned short int A10M = 10;
    sbit  A10M_bit at I2C1CON.B10;
    const register unsigned short int DISSLW = 9;
    sbit  DISSLW_bit at I2C1CON.B9;
    const register unsigned short int SMEN = 8;
    sbit  SMEN_bit at I2C1CON.B8;
    const register unsigned short int GCEN = 7;
    sbit  GCEN_bit at I2C1CON.B7;
    const register unsigned short int STREN = 6;
    sbit  STREN_bit at I2C1CON.B6;
    const register unsigned short int ACKDT = 5;
    sbit  ACKDT_bit at I2C1CON.B5;
    const register unsigned short int ACKEN = 4;
    sbit  ACKEN_bit at I2C1CON.B4;
    const register unsigned short int RCEN = 3;
    sbit  RCEN_bit at I2C1CON.B3;
    const register unsigned short int PEN = 2;
    sbit  PEN_bit at I2C1CON.B2;
    const register unsigned short int RSEN = 1;
    sbit  RSEN_bit at I2C1CON.B1;
    const register unsigned short int SEN = 0;
    sbit  SEN_bit at I2C1CON.B0;
For example if you want to use PEN bit in I2C1CON you should use PEN_bit.

To see definition file, use Ctrl+Alt+D in compiler.

Regards,
Aleksandar

Post Reply

Return to “mikroBasic PRO for PIC32 General”