Program stalling - Is it the simulator or my code?


+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    SimonGie
    Guest SimonGie's Avatar

    0 Not allowed!

    Default Program stalling - Is it the simulator or my code?

    Hi All

    I have been having some issues with code seeming to lockup for a some unknown reason.
    At first, I thought it was my code, but then I commented out most of it and just left a simple toggle and delay and it still happens.
    The toggle just toggles a port to drive a virtual LED so I can see that the code is running.



    I'm using Len's awesome serial buffer to read some NMEA strings and convert them to a different string format.
    That side of things is working, but after a minute or some, the program hangs in simulation and I have to stop the simulation and restart it.
    The issue doesnt happen if I disable the serial buffer completely, but I know it's not Len's code, because I've used it many times before without issue.
    Resetting the pic via MCLR doesn't work. The program stalls, even though when resetting via the MCLR pin, I can see via the simulation log that the pic did reset but the code never restarts....it's weird.

    Here is my code:

    Code:
    Device = 18F2550
    
    
    Config_Start
      PLLDIV = 5	;Divide by 5 (20 MHz oscillator input)
      CPUDIV = OSC1_PLL2	;[Primary Oscillator Src: /1][96 MHz PLL Src: /2]
      USBDIV = 1	;USB clock source comes directly from the primary oscillator block with no postscale
      FOSC = XT_XT	;XT oscillator (XT)
      FCMEN = OFF	;Fail-Safe Clock Monitor disabled
      IESO = OFF	;Oscillator Switchover mode disabled
      PWRT = OFF	;PWRT disabled
      BOR = OFF	;Brown-out Reset disabled in hardware and software
      BORV = 3	;Minimum setting 2.05V
      VREGEN = OFF	;USB voltage regulator disabled
      WDT = OFF	;WDT disabled (control is placed on the SWDTEN bit)
      WDTPS = 32768	;1:32768
      CCP2MX = OFF	;CCP2 input/output is multiplexed with RB3
      PBADEN = OFF	;PORTB<4:0> pins are configured as digital I/O on Reset
      LPT1OSC = OFF	;Timer1 configured for higher power operation
      MCLRE = On	;MCLR pin enabled; RE3 input pin disabled
      STVREN = OFF	;Stack full/underflow will not cause Reset
      LVP = OFF	;Single-Supply ICSP disabled
      XINST = OFF	;Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
      Debug = OFF	;Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
      Cp0 = OFF	;Block 0 (000800-001FFFh) is not code-protected
      CP1 = OFF	;Block 1 (002000-003FFFh) is not code-protected
      CP2 = OFF	;Block 2 (004000-005FFFh) is not code-protected
      CP3 = OFF	;Block 3 (006000-007FFFh) is not code-protected
      CPB = OFF	;Boot block (000000-0007FFh) is not code-protected
      CPD = OFF	;Data EEPROM is not code-protected
      WRT0 = OFF	;Block 0 (000800-001FFFh) is not write-protected
      WRT1 = OFF	;Block 1 (002000-003FFFh) is not write-protected
      WRT2 = OFF	;Block 2 (004000-005FFFh) is not write-protected
      WRT3 = OFF	;Block 3 (006000-007FFFh) is not write-protected
      WRTC = OFF	;Configuration registers (300000-3000FFh) are not write-protected
      WRTB = OFF	;Boot block (000000-0007FFh) is not write-protected
      WRTD = OFF	;Data EEPROM is not write-protected
      EBTR0 = OFF	;Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks
      EBTR1 = OFF	;Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks
      EBTR2 = OFF	;Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks
      EBTR3 = OFF	;Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks
      EBTRB = OFF	;Boot block (000000-0007FFh) is not protected from table reads executed in other blocks
    Config_End
    
    
    ;**** End of Fuse Configurator Settings ****
    ;-------------------------------------------------------------------------------
    Xtal 20
    
    
    
    
        Optimiser_Level = 3                 ' Full optimisation
        Dead_Code_Remove = On               ' Remove redundant ASM mnemonics
    '
    ' Setup the USART
    '
        Declare Hserial_Baud = 4800                 ' Set baud rate for USART 1
        Declare Hserial_RCSTA = %10010000           ' Enable serial port and continuous receive
        Declare Hserial_TXSTA = %00100000           ' Enable transmit and asynchronous mode
        Declare RsOut_Pin PORTC.6                   'setup software serial port for debugging
        Declare RsOut_Mode INVERTED                 
        Declare Serial_Baud 4800
        
        Dim Array[80] As Byte
        Dim CRC_In[2] As Byte
        Dim I As Byte
        Dim J As Byte
        Dim K As Byte
        Dim L As Byte
        Dim Temp As Byte
        Dim TalkerID[5] As Byte
        Dim LatDegrees[10] As Byte
        Dim LongDegrees[10] As Byte
        Dim LatDir As Byte
        Dim LongDir As Byte
        Dim ExtractItem As Byte
        Dim Character As Byte
        Dim CharPos As Byte
        Dim CommaCount As Byte
        Dim DataString[30] As Byte
        Dim NMEAString[50] As Byte
        Dim GPTalker[7] As Byte
        Dim FishPlot[9] As Byte
        Dim CharacterCount As Byte
        
        Clear Temp
        Clear J
        Clear
        
        '------------------------------------------------------------------------------------------------------------------------------------
    
    
        Include "Buffered_Hserin_U1.Inc"    ' Load the USART 1 interrupt handler and buffer read subroutines into memory
    
    
        
        GoTo Initialise
    
    
    
    
    Initialise:
        All_Digital = True               ' Make all digital inputs
        TRISA = 0
        TRISB = 0
        TRISC = %10011111                ' PORTC.6 is rsout pin
        Init_Usart_Interrupt             ' Initiate the USART 1 serial buffer interrupt
        Clear_Serial_Buffer              ' Clear the serial buffer and reset its pointers
    
    
    MainLoop:
            If _USART_IndexIn <> _USART_IndexOut Then
                Toggle PORTC.5             'Check to see it there is any serial data in the buffer
                'J=0                                              'reset index and clear array
                'Clear Array
                'HRSIn Wait(36),Array[J]                          'Wait for start of NMEA sentence                 Example string: $SDTLL,,2727.0300,S,15305.8530,E,,,,*46
                'Repeat                                           'Fill the array with the entire string
                '    Array[J + 1] = HRSIn
                '    Inc J
                'Until Array[J] = 42                              'until you hit the "*" delimiter
                'CRC_In[0] = HRSIn                                'Capture the next two checksum bytes
                'CRC_In[1] = HRSIn
                'GoSub LoadTalker                                 'load the NMEA talkrr ID bytes into an array
                'If TalkerID[2] = $54 And TalkerID[3] = $4C And TalkerID[3] = $4C Then       'check if it's the xxTLL talker
                '    GoSub Convert                                'Convert TLL to WPL
                'EndIf
                Clear_Serial_Buffer 
            EndIf
     DelayMS 500              
    GoTo MainLoop
    Lens serial buffer, with the ram changed from 100 to 255

    Code:
    '
    ' Interrupt-driven serial buffer for USART1 receive using a hardware high priority interrupt.
    '
    ' This subroutine replaces the compiler's Hserin/Hrsin commands library subroutines
    '
    ' For use with 18F devices only using the Proton+ Compiler version 3.3.0.0 Onwards
    '
    ' Version 2 Written by Les Johnson 17th August 2007.
    '
        #Disable HRSIn, HRSINTO, HRSIN_RCREG_READ           ' Disable the library subroutines for HRSIN with and without timeouts
    '
    ' Create the SYSTEM variables and aliases for the Buffered commands
    '
        Dim GEN     As Byte System                          ' \
        Dim GENH    As Byte System                          ' / Timeout value storage
        Dim PP0     As Byte System                          ' \
        Dim PP0H    As Byte System                          ' / Storage for FSR0L\H registers
        Dim PP1     As Byte System                          ' \
        Dim PP1H    As Byte System                          ' / Timeout inside loop counter
        Dim _USARTTimeoutInt As GEN
        Dim _USARTTimeoutIntH As GENH
        Dim _USARTTimeoutValue As _USARTTimeoutInt.Word     ' Alias the timeout value to GEN\H
        Dim _FSR0SaveInt As PP0
        Dim _FSR0SaveIntH As PP0H
        Dim _USART_FSR0_Save As _FSR0SaveInt.Word           ' Alias the FSR0L\H storage to PP0\H
        Dim InsideLoopInt As PP1
        Dim InsideLoopIntH As PP1H
        Dim _USART_InsideLoop As InsideLoopInt.Word         ' Alias the inside loop to PP1\H
        Dim _USART_OutsideLoop As PRODL.Word                ' Alias the outside loop to PRODL\H registers
        Dim _USART_FSR1_Save As Word System                 ' Storage for FSR1L\H registers
        Dim _USART_IndexIn As Byte System                   ' Pointer to the next empty location in the buffer
        Dim _USART_IndexOut As Byte System                  ' Pointer to the location of the oldest character in the buffer
    '
    ' Create the actual serial buffer in high memory
    '
    Warnings = Off
    Reminders = Off
        Declare Reserve_RAM 255                                    ' Reserve some RAM at the top of memory as a serial buffer (MAX 255)
        Symbol _USART_BufferSize = __Reserve_Ram_Size      ' The amount of RAM reserved is the buffer size (MAX 255)
        Dim _USART_RingBuffer[_USART_BufferSize] As Byte At __Start_Of_Reserve_Ram    ' Array for holding received characters
    Reminders = On
    Warnings = On
    
    
        Dim _USART_FSR0 As FSR0L.Word
        Dim _USART_FSR1 As FSR1L.Word
    '
    ' Point to the high priority hardware interrupt handler
    '
        On_Hardware_Interrupt GoTo _Usart_High_Prior_Interrupt
    
    
        GoTo _Over_Usart_Handler                             ' Jump over the subroutines
    '-------------------------------------------------------------------------------
    ' USART1 ring buffer interrupt handler
    '
    ' Input     : Interrupt is triggered on reception of a byte from the USART
    ' Output    : Array _USART_RingBuffer holds the characters received
    '           : Byte _USART_IndexIn points to the current location within the buffer
    ' Notes     : Does not indicate if an error occurs but does clear the error flags and carries on
    '
    _Usart_High_Prior_Interrupt:
        If PIR1.5 = 1 Then                                   ' Was it a USART1 byte Receive that triggered the interrupt ?
            Movlw 6                                          ' Yes. So Mask out unwanted bits
            Andwf RCSTA,W                                    ' Check for errors
            Bnz _Uart_Error                                  ' Was either error status bit set?
            _USART_FSR1_Save = _USART_FSR1                   ' Save FSR1L\H registers
            Inc _USART_IndexIn                               ' Move up the buffer
            If _USART_IndexIn >= _USART_BufferSize Then      ' End of buffer reached ?
               _USART_IndexIn = 0                            ' Yes. So clear _USART_IndexIn
            EndIf
            _USART_FSR1 = VarPtr _USART_RingBuffer           ' Point FSR1L\H to _USART_RingBuffer
            _USART_FSR1 = _USART_FSR1 + _USART_IndexIn       ' Add the buffer position to FSR1L\H
            INDF1 = RCREG                                    ' Place the received character into the buffer
            _USART_FSR1 = _USART_FSR1_Save                   ' Restore FSR1L\H registers
            Retfie Fast                                      ' Exit from the interrupt, restoring the WREG, STATUS, and BSR registers
    _Uart_Error:
        Clear RCSTA.4                                 ' Clear receiver status
        Set RCSTA.4
        Else                                                 ' Otherwise...
    ' <<< Other Interrupt Conditions and Code here >>>
        EndIf
        Retfie Fast                                          ' Exit from the interrupt, restoring the WREG, STATUS, and BSR registers
    '------------------------------------------------------------------------------
    ' Wait for a character from the interrupt driven circular buffer with timeout
    '
    ' Input     : GEN\GENH hold the timeout value in approx ms (0 to 65535)
    ' Output    : PP0 and WREG hold the value received
    '           : CARRY Flag (STATUS.0) Clear if timeout out
    ' Notes     : Uses PRODL\H as temporary variable storage
    '           : Uses FSR0L\H as buffer the pointer
    '
    #ifdef Hrsinto#Req
    HRSIn2:
    @Read#Buffer_Req = 1                                 ; Enable the _USART_GET_CHAR subroutine
        _USART_OutsideLoop = _USARTTimeoutValue          ' Save the timeout value so it doesn't get overwritten
        Clear _USART_InsideLoop                          ' Reset the inside loop counter
    _Usart_Getbuf_Outside:
        Bra     $ + 2                                    ' Delay for 2 cycles within the outside loop
    _Usart_Getbuf_Inside:
        #ifdef Watchdog_Req                              ' Delay for 1 cycle within the inside loop
            Clrwdt
        #else
            Nop
        #endif
        Movf      _USART_IndexIn,W                       ' \
        Subwf     _USART_IndexOut,W                      ' / Is there anything in the serial buffer ?
        Bnz       _Usart_Get_Char                        ' Yes. So fetch it
        WREG = 255                                       ' \
        Addwf     _USART_InsideLoop,F                    '  \
        Addwfc    _USART_InsideLoopH,F                   '    Decrement the inside and outside loops
        Addwfc    _USART_OutsideLoop,F                   '  /
        Addwfc    _USART_OutsideLoopH,F                  ' /
        Btfss     STATUS,C
        Ret                                              ' Return with the CARRY flag clear to indicate timed out
        Infsnz    _USART_InsideLoop,W
        Incfsz    _USART_InsideLoopH,W
        Bra       _Usart_Getbuf_Outside
        _USART_InsideLoop = ((59 * Xtal) / 4)            ' Set the inside loop counter based upon the XTAL frequency
        Bra       _Usart_Getbuf_Inside
    #endif
    '------------------------------------------------------------------------------
    ' Wait for a character from the interrupt driven circular buffer without timeout
    '
    ' Input     : None
    ' Output    : WREG holds the value received
    ' Notes     : Uses FSR0L\H as buffer pointers
    '
    #ifdef Hrsinx#Req
    @HRSIN
    @Read#Buffer_Req = 1                                  ; Enable the _USART_GET_CHAR subroutine
        While _USART_IndexIn = _USART_IndexOut            ' Wait for a character to apear in the serial buffer
        #ifdef Watchdog_Req
            Clrwdt                                        ' Clear the watchdog timer within the loop if required
        #endif
        Wend
    #endif
    ' Fall through to _USART_GET_CHAR
    '------------------------------------------------------------------------------
    ' Read a character from the interrupt driven circular buffer
    '
    ' Input     : None
    ' Output    : WREG holds the value received
    ' Notes     : Uses FSR0L\H as buffer pointers
    '
    #ifdef Read#Buffer_Req
    _Usart_Get_Char:
        Inc _USART_IndexOut                               ' Increment _USART_IndexOut pointer (0 to 255)
        If _USART_IndexOut >= _USART_BufferSize Then      ' End of buffer reached ?
            _USART_IndexOut = 0                           ' Yes. So clear _USART_IndexOut.
        EndIf
        _USART_FSR0_Save = _USART_FSR0                    ' Save FSR0L\H registers
        _USART_FSR0 = VarPtr _USART_RingBuffer            ' Point FSR0L\H to _USART_RingBuffer
        _USART_FSR0 = _USART_FSR0 + _USART_IndexOut       ' Add the buffer position to FSR0L\H
        WREG = INDF0                                      ' Read buffer location (_USART_IndexOut) into WREG
        PP0 = WREG                                        ' Also place it into PP0
        _USART_FSR0 = _USART_FSR0_Save                    ' Restore FSR0\H registers
        Bsf STATUS,C                                      ' Set the CARRY flag to indicate a byte received
        Return
    #endif
    '--------------------------------------------------------------------------------
    ' Initialise the USART1 interrupt
    '
    ' Input     : None
    ' Output    : None
    ' Notes     : Enables interrupt on USART1 receive.
    '           : Enables global and peripheral interrupts
    '           : If Prioritised interrupts are used, the USART interrupt priority is made high
    '
    Init_Usart_Interrupt Macro
        GoSub _Init_Usart
        Endm
    #ifdef Init_Usart_Interrupt#Req
    _Init_Usart:
        _USART_IndexIn = 0                                ' Clear the buffer internal pointer
        _USART_IndexOut = 0                               ' Clear the buffer external pointer
        PIE1.5 = 1                                        ' Enable interrupt on USART1 receive
        #ifdef __Low_Interrupts_Enabled                   ' Are we using low priority interrupts as well ?
            IPR1.5 = 1                                    ' Yes. So USART1 Receive Interrupt to High priority
        #endif
        INTCON.7 = 1                                'enable GIE - global interrupts
        INTCON.6 = 1                               ' Enable PEIE/GEIE - peripheral interrupts
        Return
    #endif
    '--------------------------------------------------------------------------------
    ' Clear the Serial Buffer
    '
    ' Input     : None
    ' Output    : None
    ' Notes     : Also resets the index pointers to the serial buffer
    '
    Clear_Serial_Buffer Macro
        GoSub _Clear_Usart_Buffer
        Endm
    #ifdef Clear_Serial_Buffer#Req
    _Clear_Usart_Buffer:
        PIE1.5 = 0                                 ' Disable interrupt on USART1 receive
        Clear _USART_RingBuffer                           ' Clear the serial buffer
        _USART_IndexIn = 0                                ' Clear the buffer internal pointer
        _USART_IndexOut = 0                               ' Clear the buffer external pointer
        PIE1.5 = 1                                 ' Re-Enable interrupt on USART1 receive
        Return
    #endif
    '--------------------------------------------------------------------------------
    _Over_Usart_Handler:
    As you can see, it's nothing special. So why is it hanging?
    I haven't tried it in real life yet, so there is a possibility it's my PC or the sim software. (Proteus)

    Any ideas?

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.

  • #2
    SimonGie
    Guest SimonGie's Avatar

    0 Not allowed!

    Default Re: Program stalling - Is it the simulator or my code?

    So it seems to only happen when I actually

    Init_Usart_Interrupt

    If I comment that out, the code runs fine even after a mclr.

    If I initialise the buffer, it seems to get stuck in the interrupt routine where it checks the status of PIR1.5

    Code:
    If PIR1.5 = 1 Then                                   ' Was it a USART1 byte Receive that triggered the interrupt ?
            Movlw 6                                          ' Yes. So Mask out unwanted bits
            Andwf RCSTA,W                                    ' Check for errors
            Bnz _Uart_Error                                  ' Was either error status bit set?
            _USART_FSR1_Save = _USART_FSR1                   ' Save FSR1L\H registers
            Inc _USART_IndexIn                               ' Move up the buffer
            If _USART_IndexIn >= _USART_BufferSize Then      ' End of buffer reached ?
               _USART_IndexIn = 0                            ' Yes. So clear _USART_IndexIn
            EndIf
            _USART_FSR1 = VarPtr _USART_RingBuffer           ' Point FSR1L\H to _USART_RingBuffer
            _USART_FSR1 = _USART_FSR1 + _USART_IndexIn       ' Add the buffer position to FSR1L\H
            INDF1 = RCREG                                    ' Place the received character into the buffer
            _USART_FSR1 = _USART_FSR1_Save                   ' Restore FSR1L\H registers
            Retfie Fast                                      ' Exit from the interrupt, restoring the WREG, STATUS, and BSR registers
    PIR1.5 is supposed to clear when RCREG is read, but maybe the VSM is not doing this in simulation.

    I'm going to run it on real hardware tomorrow and see if the problem goes away.

  • 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
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,427
    Thumbs Up
    Received: 296
    Given: 142
    Total Downloaded
    1.75 GB

    0 Not allowed!

    Default Re: Program stalling - Is it the simulator or my code?

    Where does it stall? Press pause witin Isis and it will show you where it is within the code.

  • 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.

  • #4
    SimonGie
    Guest SimonGie's Avatar

    0 Not allowed!

    Default Re: Program stalling - Is it the simulator or my code?

    Well, it's not so much a stall.
    It just doesn't seem to leave the interrupt routine.
    It continuously cycles through the code in red and never leaves.
    This happens after about a minute of normal operation, or directly after a master clear reset.
    So maybe there is a issue with the error bits being set for some reason. Though all of the serial comms is simulated using Virtual Serial Ports Emulator and NEMATalker.


    _Usart_High_Prior_Interrupt:


    If PIR1.5 = 1 Then ' Was it a USART1 byte Receive that triggered the interrupt ?
    Movlw 6 ' Yes. So Mask out unwanted bits
    Andwf RCSTA,W ' Check for errors
    Bnz _Uart_Error ' Was either error status bit set?
    _USART_FSR1_Save = _USART_FSR1 ' Save FSR1L\H registers
    Inc _USART_IndexIn ' Move up the buffer
    If _USART_IndexIn >= _USART_BufferSize Then ' End of buffer reached ?
    _USART_IndexIn = 0 ' Yes. So clear _USART_IndexIn
    EndIf
    _USART_FSR1 = VarPtr _USART_RingBuffer ' Point FSR1L\H to _USART_RingBuffer
    _USART_FSR1 = _USART_FSR1 + _USART_IndexIn ' Add the buffer position to FSR1L\H
    INDF1 = RCREG ' Place the received character into the buffer
    _USART_FSR1 = _USART_FSR1_Save ' Restore FSR1L\H registers
    Retfie Fast ' Exit from the interrupt, restoring the WREG, STATUS, and BSR registers
    _Uart_Error:
    Clear RCSTA.4 ' Clear receiver status
    Set RCSTA.4
    Else ' Otherwise...
    ' <<< Other Interrupt Conditions and Code here >>>
    EndIf
    Retfie Fast ' Exit from the interrupt, restoring the WREG, STATUS, and BSR registers




    Last edited by SimonGie; 2nd July 2017 at 22:27.

  • 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
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    489
    Thumbs Up
    Received: 59
    Given: 0
    Total Downloaded
    408.14 MB

    0 Not allowed!

    Default Re: Program stalling - Is it the simulator or my code?

    That routine might need a little adjusting.

    You're probably getting a Framing Error (RCSTA.FERR). This could be due to a baudrate mismatch, or if the RX pin is held low > one char time. FERR is buffered along with the RCREG, and doesn't clear with toggling CREN.

    The only way to "clear" FERR is to read RCREG. It'll be updated when the next char is received. I suppose you could also disable the receiver but that'll likely cause more issues than it would solve.

    OERR is different. That one can be cleared by toggling CREN. It means that you've already lost a byte.

  • 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.

  • #6
    SimonGie
    Guest SimonGie's Avatar

    0 Not allowed!

    Default Re: Program stalling - Is it the simulator or my code?

    Been running for 3 hours without fail now in real life....must be something to do with the simulation software and/or the virtual serial port.

  • 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
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    489
    Thumbs Up
    Received: 59
    Given: 0
    Total Downloaded
    408.14 MB

    0 Not allowed!

    Default Re: Program stalling - Is it the simulator or my code?

    Have you tried generating a framing error and see what happens?

    You can do this by sending a serial BREAK, by setting the terminal's baudrate to 1/2 the rate of the pic and sending an ASCII space char, or by changing the terminal to send 8 bits + fixed low parity.

    You should get stuck in the isr again.

  • 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. Modification of program code by data in external memory
      By geoff_c in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 22nd May 2018, 15:51
    2. Disabling/Enabling MCLR in program Code 12F629
      By robbed666 in forum Proton Plus Compiler v3
      Replies: 4
      Last Post: 19th February 2012, 15:01
    3. Programmable simulator needed
      By charliecoultas in forum The Lounge
      Replies: 2
      Last Post: 13th October 2011, 08:58
    4. [SOLVED !] LCD display with simulator
      By tom147 in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 15th April 2005, 08:17
    5. [SOLVED !] Sweet PIC Simulator
      By picnaut in forum Wanted and For Sale
      Replies: 1
      Last Post: 20th November 2004, 23:19

    Members who have read this thread : 36

    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