Today 09:32
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 0
Yesterday 22:00
Forum: The Lounge
Starter: Henk57
Views: 0
Replies: 105
Yesterday 15:18
Forum: Proton Plus Compiler v3
Starter: Henk57
Views: 0
Replies: 20
Go to last post By: towlerg
Yesterday 13:20
Forum: Wish List / Product Feedback
Starter: Beginner
Views: 0
Replies: 8
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Junior Member mjturner's Avatar
    Join Date
    Dec 2003
    Posts
    53
    Thumbs Up
    Received: 7
    Given: 0
    Total Downloaded
    241.56 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
    53
    Thumbs Up
    Received: 7
    Given: 0
    Total Downloaded
    241.56 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
    53
    Thumbs Up
    Received: 7
    Given: 0
    Total Downloaded
    241.56 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....

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, 16:00
  2. Proton full editio won't compile
    By LEDfan in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 31st December 2011, 17: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, 11:24

Members who have read this thread : 31

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