My first DT_INT code has a problem.....


Closed Thread
Results 1 to 3 of 3

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I would think it's because you set the baudrate within this loop, and it need some time for the USART to initialize/settle. Usually, you want to set the USART at the top and only once. So my guess is to move the @ USART_Init 9600 line before the main.

    You could still place the following lines at the top of your code (with all other register init), and forget @ USART_Init
    Code:
    RCSTA = $90 ' Enable serial port & continuous receive
    TXSTA = $20 ' Enable transmit, BRGH = 0
    SPBRG = 25  ' 9600 Baud @ 16MHz, 0.16%
    Steve

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

  2. #2
    Join Date
    Apr 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Thanks Steve,

    I'll look into that.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 22:55
  2. 16F883 Code Verify Problem
    By munromh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 12:47
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  4. problem with my code
    By civicgundam in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd February 2008, 02:52
  5. Code problem
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th May 2006, 05:43

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