hserout issues on the 18F26K83


Results 1 to 14 of 14

Threaded View

  1. #3
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    I've set the hardware config totally manually from the datasheet and via PBP defines (suggested in the supplementary document PIC18FxxK42_notes) and many hybrids of the 2 methods.

    Code:
    OSCFRQ = %1000 '64Mhz
    Define OSC 64
    
    '******************************************************************************
    'Configure UART Control Register 0
    U1CON0.7 = 1 'BRGS = 1 (high speed baud generator)
    U1CON0.6 = 0 'ABDEN = 0 Auto-baud Detect Disabled 
    U1CON0.5 = 1 'TXEN: Transmit Enabled
    U1CON0.4 = 0 'RXEN: Receive Disabled
    U1CON0.3 = 0 '0000 = Asynchronous 8-bit UART mode
    U1CON0.2 = 0 '0000 = Asynchronous 8-bit UART mode
    U1CON0.1 = 0 '0000 = Asynchronous 8-bit UART mode
    U1CON0.0 = 0 '0000 = Asynchronous 8-bit UART mode
    
    U1CON1.7 = 0 'Turn Serial port 1 off for baud setting
     
    U1BRGL = 138  'Baud Divisor low byte
    U1BRGH = 1    'Baud Divisor high byte
    U1RXPPS = %1011 'Assign UART RX pin to RB3
    RB0PPS = %010011  'Assign UART1 TX pin to RB0
    U1CON1.7 = 1 'Turn Serial port 1 on
    and the more straightforward method:

    Code:
    Define OSC 64
    DEFINE HSER_RXREG PORTB
    DEFINE HSER_RXBIT 3
    DEFINE HSER_TXREG PORTB
    DEFINE HSER_TXBIT 0
    DEFINE HSER_BAUD 115200
    If that was the issue, then why does everything in the quote marks come through okay?

    Regards,

    Troy
    Last edited by rocket_troy; - 13th May 2024 at 16:46.

Similar Threads

  1. Loop issues
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 30th September 2021, 01:42
  2. A/D compiler issues
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th March 2014, 13:24
  3. A/D, and compiler issues.
    By BobEdge in forum PBP3
    Replies: 4
    Last Post: - 27th March 2014, 13:20
  4. button press AND hserout issues?!
    By Giulio in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st July 2011, 01:22

Members who have read this thread : 1

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