Interrupt Driven Serial Input using DT_Ints?


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    The datasheet for the pic just refers to TCSTAx, and at first I was setting them up with HSER_RCSTA and HSER2_RCSTA, but out of mass frustration, thought I would see if it should really be HSER1 & HSER2. (Once again, it's logical, but wrong!)

    Do you see any reason uart2 isn't working at 115k?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by circuitpro View Post
    Do you see any reason uart2 isn't working at 115k?
    From a software point of view, no.
    PBP does exactly the same thing with both USARTS, which looks like this ...
    Blue is EUSART1.
    Green is EUSART2.
    Code:
    000000                01183     ORG RESET_ORG               ; Reset vector at 0
    000000 EF13 F000      01193         goto    INIT            ; Finish initialization
                          02343 HSEROUT CLRWDT?                 ; Keep Watchdog clear
    000004 0004               M         clrwdt
    000006 A89E           02344         btfss   PIR, TXIF       ; Wait till ready
    000008 D7FD           02345         bra     HSEROUT
    00000A 6EAD           02369         movwf   TXREG           ; Send the char
    00000C 80D8           02370         bsf     STATUS, C       ; Set no timeout for Serout2mod
    00000E EF10 F000      02371         goto    DUNN            ; That's it
                          02567 HSEROUT2 CLRWDT?                ; Keep Watchdog clear
    000012 0004               M         clrwdt
    000014 A8A4           02568         btfss   PIR3, TX2IF     ; Wait till ready
    000016 D7FD           02569         bra     HSEROUT2
    000018 6E6D           02593         movwf   TXREG2          ; Send the char
    00001A 80D8           02594         bsf     STATUS, C       ; Set no timeout for Serout2mod
    00001C EF10 F000      02595         goto    DUNN            ; That's it
    000020 0100           07799 DUNN    movlb   0               ; 1 Reset banks to 0
    000022 0004               M         clrwdt
    000024 0012           07801         return                  ; 2 Done
    000026                07815 INIT
    000026 0E56               M         movlw   low (86)
    000028 6EAF               M         movwf   SPBRG
    00002A 0E24               M         movlw   low (24h)
    00002C 6EAC               M         movwf   TXSTA
    00002E 0E90               M         movlw   low (90h)
    000030 6EAB               M         movwf   RCSTA
    000032 0E56               M         movlw   low (86)
    000034 6E6F               M         movwf   SPBRG2
    000036 0E24               M         movlw   low (24h)
    000038 6E6C               M         movwf   TXSTA2
    00003A 0E90               M         movlw   low (90h)
    00003C 6E6B               M         movwf   RCSTA2
    00003E                07852 main
    00003E 6A7F               M         clrf    SPBRGH1
    000040 867E               M         bsf     BAUDCON1, 003h
    000042 6A7D               M         clrf    SPBRGH2
    000044 867C               M         bsf     BAUDCON2, 003h
    000046 0E00               M         movlw   000h
    000048 DFDD               M         rcall   HSEROUT
    00004A 0E00               M         movlw   000h
    00004C DFE2               M         rcall   HSEROUT2
    Which leaves hardware.
    Something with the 18F6722? (doubtfull). Nothing in the errata sheet.
    Extra capacitance on the PCB or serial cable. Bad cable?
    <strike>Not enough capacitance on the MAX232?</strike> OOPS, RS422/RS485 ... no MAX232

    Hard to tell.
    Last edited by Darrel Taylor; - 12th August 2010 at 02:51. Reason: 485
    DT

  3. #3
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Wink

    That's very helpful - Thanks! It's going directly to a 75ALS180 (RS485), and the signal looks good on a scope, so I'll do some more testing - focusing on hardware now.

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