--- This is a test - only visible to admins ---
--- advertisement may go here ---
Go to last post By: pic-ignorant
Yesterday 23:06
Forum: The Lounge
Starter: pic-ignorant
Views: 0
Replies: 0
Yesterday 22:35
Forum: Website / Forum Issues
Starter: rcurl
Views: 0
Replies: 1
Yesterday 16:56
Forum: Absolute Beginners Section
Starter: amod
Views: 0
Replies: 15
Yesterday 16:28
Forum: Proton Plus Compiler v3
Starter: evoortman
Views: 0
Replies: 3
Go to last post By: yvesmazzon
Yesterday 15:58
Forum: WIKI Discussion
Starter: yvesmazzon
Views: 0
Replies: 0
Yesterday 13:59
Forum: Proton Plus Compiler v3
Starter: normnet
Views: 25425
Replies: 73
Yesterday 12:37
Forum: The Lounge
Starter: Oldhack
Views: 0
Replies: 7
Yesterday 09:36
Forum: Projects discussion
Starter: steyn
Views: 0
Replies: 7
Yesterday 09:34
Forum: Third Party Developments
Starter: leonj
Views: 0
Replies: 3
Yesterday 07:08
Forum: The Lounge
Starter: basparky
Views: 0
Replies: 17
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default 16F15345 Won't Assemble (but does compile)

    i'm having trouble with targeting the 16F15345 chip. I'm using the hardware serials (sync and async) and i'm getting the following not being found during the final assembly:
    PP_RCIF
    RX1PPS

    I've manually put in the lines:
    Symbol RX1PPS=0X1ECB
    Symbol PP_RCIF=5

    With these in place it does assemble. I looked them up in the .ASM file and it looks like an extra digit is either missing or present.

    However I'm not able to receive anything on the async UART. I've remapped the hardware serial in to port A5 and the out to A4 via the PPS registers. I've even manually mapped them as well in code just in case when it didn't work via the directives. No matter what I do I receive nothing on the UART. I've confirmed that data is flowing to the UART pin, the HRSin command worked just fine before on a different PIC chip.

    The relevant code is here:


    Declare Hserial_Baud = 115200 ' Set baud rate to 115200
    Declare Hserial_TXSTA = %00100100 ' Enable transmit and asynchronous mode
    Declare Hserial_RCSTA = %10010000
    Declare Hserial_Clear = On


    Declare Hserin_pin PORTA.5
    Declare Hserout_Pin PORTA.4

    HRSIn {15000,WiFi_PowerOn}, Wait("AWAKE"),wifi_byte

    Is there something fundamentally broken about the hardware serial implementation with this PIC chip and Proton, given the assemble errors that i'm getting?

  2. #2
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    I should add that the following code is an example. It should just echo back whatever is received, and just send a # every 5 seconds it doesn't receive something. When I connect up to a serial port I see the # coming in, but never any echo of data sent.

    Device = 16F15345


    Config1 FEXTOSC_OFF, RSTOSC_HFINT32, CLKOUTEN_OFF, CSWEN_ON, FCMEN_ON
    Config2 MCLRE_OFF, PWRTE_OFF, LPBOREN_OFF, BOREN_ON, BORV_LO, ZCD_OFF, PPS1WAY_ON, STVREN_ON
    Config3 WDTCPS_WDTCPS_31, WDTE_OFF, WDTCWS_WDTCWS_7, WDTCCS_HFINTOSC
    Config4 BBSIZE_BB512, BBEN_OFF, SAFEN_OFF, WRTAPP_OFF, WRTB_OFF, WRTC_OFF, WRTSAF_OFF, LVP_ON
    Config5 CP_OFF


    Xtal = 32
    All_Digital = TRUE

    Declare Optimiser_Level = 0


    Dim a As Byte

    Declare Hserial_Baud = 9600
    Declare Hserial_TXSTA = %00100100 ' Enable transmit and asynchronous mode
    Declare Hserial_RCSTA = %10010000
    Declare Hserial_Clear = On


    Declare Hserin_pin PORTA.5
    Declare Hserout_Pin PORTA.4
    Symbol SerialOut=PORTA.4
    Symbol SerialIn=PORTA.5


    Symbol PP_RCIF=5
    Symbol RX1PPS=0X1ECB


    DelayMS 2


    Output SerialOut
    Input SerialIn




    RepeatIt:
    a=HRSIn , {5000,TimeOutHit}
    HRSOut a
    GoTo RepeatIt
    TimeOutHit:
    HRSOut "#"
    GoTo RepeatIt



    While the following code using SerIn etc and that works just fine:

    Device = 16F15345


    Config1 FEXTOSC_OFF, RSTOSC_HFINT32, CLKOUTEN_OFF, CSWEN_ON, FCMEN_ON
    Config2 MCLRE_OFF, PWRTE_OFF, LPBOREN_OFF, BOREN_ON, BORV_LO, ZCD_OFF, PPS1WAY_ON, STVREN_ON
    Config3 WDTCPS_WDTCPS_31, WDTE_OFF, WDTCWS_WDTCWS_7, WDTCCS_HFINTOSC
    Config4 BBSIZE_BB512, BBEN_OFF, SAFEN_OFF, WRTAPP_OFF, WRTB_OFF, WRTC_OFF, WRTSAF_OFF, LVP_ON
    Config5 CP_OFF

    Xtal = 32
    All_Digital = TRUE

    Declare Optimiser_Level = 0


    Dim a As Byte


    Declare RsIn_Pin PORTA.5
    Declare RsOut_Pin PORTA.4
    Declare Serial_Baud 9600
    Declare RsIn_Timeout 5000
    Declare Serial_Data 8
    Declare RsOut_Mode 0
    Declare RsIn_Mode 0

    Symbol SerialIn=PORTA.5
    Symbol SerialOut=PORTA.4


    DelayMS 2


    RA5PPS=0
    RA4PPS=0
    Output SerialOut
    Input SerialIn
    Clear SerialOut


    RepeatIt:
    a=RsIn ,{TimeOutHit}
    RsOut a
    GoTo RepeatIt
    TimeOutHit:
    RsOut "#"
    GoTo RepeatIt


    Unfortunately it isn't possible to use SerIn/SerOut as the comms on the external device run at 115200, which is outside the supported range.

  3. #3
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    Any thoughts on this? I'm getting really frustrated! I just can't get this PIC to do serial comms....

  4. #4
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    This is really driving me nuts. Please could someone respond?

    I've tried the software serial port, but I need to do too much between bits for that to work reliably. I really need the hardware serial port to work. Please!

    I do appreciate the issues with the moving target of different chips, but even an acknowledgement would have been helpful.

  5. #5
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,083
    Thumbs Up
    Received: 102
    Given: 23
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    I wonder what you mean with 'does compile' and 'won't assemble'. I advise you to throw away the .hex, .asm and .lst files and compile it again. The compiler will automatically invoke the assembler.
    If after compiling there is no .hex the problem probably lies in the code. Do you get any error/warning from the compiler?

  6. #6
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,282
    Thumbs Up
    Received: 111
    Given: 37
    Total Downloaded
    1.31 GB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    Isn't RX1PPS a register to be set something like this:
    RX1PPS = %00011111
    or should it be more like
    RA1PPS = %00011111

    Above not real values.

  7. #7
    Junior Member Rox's Avatar
    Join Date
    Sep 2014
    Posts
    13
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    6.81 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    i think you need to unlock PPSLOck before you select the usart pins.. try this.

    INTCON = 0 'disable interrupt
    PPSLOCK = 0x55
    PPSLOCK = 0xAA
    PPSLOCK = 0x00 'unlock PPS
    ' enter IO here
    RXPPS = 0x0C 'RB4 -> RX
    RA0PPS = 0x14 'RA0 -> TX

    PPSLOCK = 0x55
    PPSLOCK = 0xAA
    PPSLOCK = 0x01 'Lock PPS
    INTCON = 0b10000000 'Enable interrupt

  8. #8
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    Quote Originally Posted by hadv215 View Post
    I wonder what you mean with 'does compile' and 'won't assemble'. I advise you to throw away the .hex, .asm and .lst files and compile it again. The compiler will automatically invoke the assembler.
    If after compiling there is no .hex the problem probably lies in the code. Do you get any error/warning from the compiler?
    What I mean is that the compiler runs and completes its stuff, the final stage where it calls the assembler fails. The assembler reports the failure because some of the labels used in the asm output don't exist. This seems to be simply the compiler not outputting the correct labels. I've tried to fudge it by including Symbol references for those missing labels, but while that allows it to compile it doesn't make the serial port work.

    Since my original post I tried to make it work with hardware serial ports 1 and 2, but can't get it to work with either. I've also tried using the compiler supplied serial port mapping and manually mapping the pins myself. Neither generates a valid response.

  9. #9
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    Quote Originally Posted by normnet View Post
    Isn't RX1PPS a register to be set something like this:
    RX1PPS = 011111
    or should it be more like
    RA1PPS = 011111

    Above not real values.
    Yes.... in theory the compiler should configure the PPS registers automatically based upon the DECLARE statements. The reason you see the line "Symbol RX1PPS=0X1ECB" is because that was the only way I could get the assemble stage to work.

    I did try manually configuring the PPS registers, but didn't have any more luck with that than I did with the compiler driven method.

  10. #10
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    70
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    392.84 MB

    0 Not allowed!

    Default Re: 16F15345 Won't Assemble (but does compile)

    Quote Originally Posted by Rox View Post
    i think you need to unlock PPSLOck before you select the usart pins.. try this.

    INTCON = 0 'disable interrupt
    PPSLOCK = 0x55
    PPSLOCK = 0xAA
    PPSLOCK = 0x00 'unlock PPS
    ' enter IO here
    RXPPS = 0x0C 'RB4 -> RX
    RA0PPS = 0x14 'RA0 -> TX

    PPSLOCK = 0x55
    PPSLOCK = 0xAA
    PPSLOCK = 0x01 'Lock PPS
    INTCON = 0b10000000 'Enable interrupt
    Thanks - I'll give it a go. But I had no such issue with the SPI port. I re-mapped that just fine by setting the PPS register values directly, no need for unlocking. I didn't configure anything to lock the PPS assignments. Is there something different about the UART vs SPI when it comes to PPS?

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Compiles - but then fails to assemble
    By mjturner in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 11th February 2018, 17:00
  2. Proton full editio won't compile
    By LEDfan in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 31st December 2011, 18:03
  3. Why won't this compile?
    By g6osv in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 5th October 2010, 21:10
  4. Conditional Compile/Assemble commands
    By johngb in forum Wish List / Product Feedback
    Replies: 2
    Last Post: 24th November 2004, 12:24

Members who have read this thread : 40

Actions :  (Set Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

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