USART2 setting for 1MHzCPU + 4PLL


Closed Thread
Results 1 to 33 of 33

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: USART2 setting for 1MHzCPU + 4PLL

    well after fiddling and some reading of the datasheet - yes i am slake sometimes

    the following setting were applied and work

    one thing is clear is that the serial ports setting applied worked only when i used the setting based on the core base osc speed of 1mhz , not the 4mhz which is applied with the PPL

    this seems to hold up true also settings with timer 0

    it sort of make me think that the PPL is not looked at with core timing features of the chip , but i know this is not true when using it at 32 and 64,

    anyone can explain this to me be great

    cheers

    Sheldon

    Code:
     DEFINE OSC 4                ' Timing referance for pause , pauseus commands
        DEFINE ADC_BITS 12          ' Number of bits in ADCIN result - Required for adcin command 
        DEFINE PULSIN_MAX 2000      ' Maximum counts( clock ticks) allowed before pulsin times out( 2000 ^ 1.25us =  2.5 ms)
        DEFINE HSER_PORT 2          ' Hser port 2 use 
        DEFINE HSER2_RCSTA 90h      ' Hser2 receive status init 
        DEFINE HSER2_TXSTA 24h      ' Hser2 transmit status init  ( BIT2 -BRGH 1= HI SPEED, 0= LOW SPEED )
        DEFINE HSER2_CLROERR 1      ' Clear overflow automatically
        DEFINE HSER2_BAUD 19200     ' Hser2 baud rate
        DEFINE HSER2_SPBRG 12       ' 19200 Baud @ SPBRGH = 12 0.16% error
        BAUDCON2.3 = 1              ' set BRG16 = 1 - 16BIT/ASYNC

  2. #2
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: USART2 setting for 1MHzCPU + 4PLL

    I must have missed it.....

    What PIC?
    Regards,
    TABSoft

Similar Threads

  1. Micrtochip AN1310 for USART2
    By cerr99 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 27th May 2011, 19:59
  2. USBBufferSize setting
    By Ronald123 in forum USB
    Replies: 4
    Last Post: - 18th April 2008, 13:33
  3. Setting up the oscillator
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd October 2007, 15:53
  4. setting up HPWM
    By sunny in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd October 2006, 02:36
  5. setting register
    By volcane in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th April 2006, 23:46

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