Help with ppi and def files for 24FJ256GA704


+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    826
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    889.46 MB

    0 Not allowed!

    Default Help with ppi and def files for 24FJ256GA704

    I have been trying to get this pic working but can't go any further at the moment.

    I'd like to use i2c but as soon as I use any i2c commands I get an asm linker error about an undefined reference to i2c1con even though there is no mention of this register in my code or the ppi and def files.

    Here is the code I'm using:

    Code:
    Device = 24FJ256GA704
    
    Config FSEC = AIVTDIS_OFF, BSEN_OFF, BSS_DISABLED, BWRP_OFF, CSS_DISABLED, CWRP_OFF, GSS_DISABLED, GWRP_OFF
    Config FBSLIM = BSLIM_BSLIM
    Config FSIGN = FNOSC_FRC, IESO_ON, PLLMODE_DISABLED
    Config FOSCSEL = FCKSM_CSDCMD, IOL1WAY_ON, OSCIOFCN_ON, PLLSS_PLL_FRC, POSCMD_NONE, SOSCSEL_ON
    Config FOSC = FWDTEN_OFF, FWPSA_PR32, WDTCLK_LPRC, WDTCMX_WDTCLK, WDTPS_PS32768, WDTWIN_WIN25, WINDIS_OFF
    Config FWDT = BOREN_OFF, DNVPEN_ENABLE, LPCFG_OFF
    Config FPOR = ICS_PGD1, JTAGEN_OFF
    Config FICD = ALTCMPI_DISABLE, ALTI2C1_ALTI2CEN, SOSCHP_ON, TMPRPIN_OFF
    
    ;-------------------------------------------------------------------------------
    
    Declare Xtal = 8
    
    '*************************************** Serial Setup **************************************
    
    Declare Hserial_Baud = 57600             
    Declare HRSOut1_Pin = PORTC.8           
    Declare HRSIn1_Pin = PORTC.7  
    PPS_Output(cOut_Pin_RP24, cOut_Fn_U1TX)
           
    '*************************************** I2C Setup **************************************                  
    Declare SDA_Pin PORTB.9
    Declare SCL_Pin PORTB.8
    Declare Hbus_Bitrate 400
    
    
    Output PORTA
    Output PORTB
    Output PORTC
    
    '*************************************** MAIN *********************************************
    Main:
        DelayMS 1000
        Toggle PORTB.12
        HRSOut "Please help me Les! " 
        HBusOut $FF
    GoTo Main
    Attached are modified versions of the ppi and def files. pic24fj256ga704.zip

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    412
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    Hi,

    I think it would be necessary to connect the I2C device to the pins interspersed with something like:

    PPS_Input(cIn_Pin_RP8, cIn_Fn_SCK1IN)' SCK1 Clock Input (SCK1IN) Connected to RP8
    PPS_Input(cIn_Pin_RP9, cIn_Fn_SDI1)' SDI1 Data Input (SDI1) Connected to RP9

    Regards,
    Gamboa

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    826
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    889.46 MB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    I'm pretty sure that the i2c pins are fixed and not mappable with PPS.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    412
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    Hi,

    It's true Simon.


    Check the register value: I2CxCONL
    bit 15 I2CEN: I2Cx Enable bit (writable from software only)
    1 = Enables the I2Cx module and configures the SDAx and SCLx pins as serial port pins
    0 = Disables the I2Cx module; all I2C pins are controlled by port functions
    But this value does not think that it alters the result of the assembly process

    Regards,
    Gamboa

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    412
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    1 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    Hi Simon,

    I have compiled your program and it gives me the same error. I have looked at the .ASM file and found that the following is defined:

    .equ I2C1CON1, 0x049a
    .equ I2C1CON1H, 0x049b
    .equ I2C1CONL, 0x049a
    .equ I2C1CONLH, 0x049b
    .equ I2C1CON2, 0x049c
    .equ I2C1CON2H, 0x049d
    .equ I2C1CONH, 0x049c
    .equ I2C1CONHH, 0x049d
    But then below something that is not defined is used:

    .global _hbusx__send_nack
    _hbusx__send_nack:
    rcall __hbusx__wait_for_idle_
    bset.w i2c1con,#pp_ackdt
    bset.w i2c1con,#pp_acken
    btsc.w i2c1con,#pp_acken
    bra $ - 2
    return
    I do not know if that could be the problem.

    Regards,
    Gamboa

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    826
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    889.46 MB

    1 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    Good thinking Gamboa, I had not thought to look at the asm, not that it means much to me anyway but all the references relating to the i2c operation in the code section use the I2C1CON register.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    412
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    Hi,
    At this point I do not know what else can be done
    Regards,
    Gamboa

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    826
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    889.46 MB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    I think Les is the only one who can fix this now, thanks for your help.

    simon

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    826
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    889.46 MB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    Les

    I expect you've seen this or one of the other posts on the problems with this chip.

    It would be good to get your opinion on this even if it's not something you want to fix. I understand that you don't have much time and get little financial reward for all the work you put in.

    I have no idea how much time and effort would need to go into supporting this chip family, maybe it's a lot of work and not something you want to do?

    It would be good to know what your thoughts are.

    Regards
    Simon

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #10
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    490
    Thumbs Up
    Received: 29
    Given: 7
    Total Downloaded
    3.57 GB

    0 Not allowed!

    Default Re: Help with ppi and def files for 24FJ256GA704

    I think the problem is that on some devices that have multiple registers associated with something the first register is terminated with a number and on other devices it is not, i.e.
    Device 1: is I2C1CON & I2C1CON2
    Device 2: is I2C1CON1 & I2C1CON2

    and this can throw off the compiler.

    If you open the PPI file, find the register definition for I2CON1 and add the line...
    I2C1CON EQU 0x49A
    that gives the compile the alternative name I2C1CON for the I2C1CON1 register which appear to resolves the problem at least in so far as the program compiles (compiler version 3.7.0.6), although the does not necessarily mean it will do what you want.
    Note: I also had to replace the the PPS_output command with RPOR12 = $0003 which I believe does the same thing. The syntax of the PPR_Output command looks right to me but I as have never used it before I am unsure as to why the compiler does not like it, however if are using a newer compiler version that may not be necessary.
    Last edited by Stephen Moss; 10th May 2019 at 10:13.

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Les has just uploaded PIC18F6XK40 PPI and Def files!
    By top204 in forum Proton Users File Server
    Replies: 0
    Last Post: 20th January 2017, 15:24
  2. DEF and PPI files
    By yvesmazzon in forum Tips 'n Tricks
    Replies: 4
    Last Post: 29th July 2016, 22:24
  3. PIC18F24J50 PPI+def files
    By RayEllam in forum Proton Plus Compiler v3
    Replies: 15
    Last Post: 9th June 2012, 22:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts