HSERIN2 not working on PIC18F97J60 ???


Results 1 to 9 of 9

Threaded View

  1. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    Since you can transmit, your baudrate setting has to be right. i think it's more a library mistake...
    Code:
    LOC  OBJECT CODE     LINE SOURCE TEXT
      VALUE
    
    00000C 6E01           02333         movwf   R0
    00000E 500E           02334         movf    R6 + 1, W
    000010 6E02           02335         movwf   R0 + 1
    000012 6A03           02336         clrf    R1              ; Start off inner loop counter at zero
    000014 6A04           02337         clrf    R1 + 1
                          02338 hserin2toloop CLRWDT?NOP        ; 1 (8, 16) Keep Watchdog timer clear
                              M     ifndef NO_CLRWDT
    000016 0004               M         clrwdt
                              M     else
                              M         nop
                              M     endif
    000018 BA9E           02339         btfsc   PIR, RCIF       ; 2 Check for char
    00001A D00C           02340         bra     HSERIN2X        ; We're started
    00001C 6AE8           02341         clrf    WREG            ; 1 For subtracts
    00001E 0603           02342         decf    R1, F           ; 1
    000020 5A04           02343         subwfb  R1 + 1, F       ; 1
    000022 E2F9           02344         bc      hserin2toloop   ; 2 / 1 End of inner loop
    000024 0601           02345         decf    R0, F           ; 1
    000026 5A02           02346         subwfb  R0 + 1, F       ; 1
    000028 E307           02347         bnc     hserin2done     ; 1 Timed out (C clear)
    00002A 0E0C           02348         movlw   low (HSERIN2TO_DELAY)   ; 1 Reset inside loop counter
    00002C 6E03           02349         movwf   R1              ; 1
    00002E 0E03           02350         movlw   low ((HSERIN2TO_DELAY) >> 8)    ; 1
    000030 6E04           02351         movwf   R1 + 1          ; 1
    000032 D7F1           02352         bra     hserin2toloop   ; 2 End of outer loop
    To me that line in red should be
    Code:
    BTFSC PIR3,RC2IF
    How to change it... open PBPPIC18.lib file, go to line 2339
    Code:
    hserin2toloop CLRWDT?NOP	; 1 (8, 16) Keep Watchdog timer clear
    	btfsc	PIR, RCIF	; 2 Check for char
    	bra	HSERIN2X	; We're started
    	clrf	WREG		; 1 For subtracts
    and change this line to
    Code:
    BTFSC PIR3,RC2IF
    Save the file and try again.. finger crossed...

    The problem (if it's the problem) also seems to be in PBPPI18L.lib @ line 2620

    The way it was before, it checked for a character... but on USART1
    Last edited by mister_e; - 26th April 2008 at 19:55.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 2x16 lcd not working with pic16f72
    By vu2iia in forum Schematics
    Replies: 4
    Last Post: - 16th February 2011, 14:59
  2. Blink.Bas on 18f45k20 Newbie seeks working example.
    By DiscoEd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th December 2009, 03:36
  3. Pic 16 F628A not working
    By turkuaz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th March 2009, 12:26
  4. Second serial port access ( Hserin2 )
    By MegaADY in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2007, 18:01
  5. Hserin not working...
    By robert0 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd August 2005, 12:25

Members who have read this thread : 0

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

Posting Permissions

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