serout : false byte after boot up


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Posts
    72

    Default serout : false byte after boot up

    hello all

    i have an effect now which i have some time before also...

    on a pin of a pic is max232. i send some bytes with serout. all goes right.

    but when i start up - the pic get the power - the first byte is sending is not correct. ever the first after boot up! after then the same routine with the same value send it right.
    when i send first a byte for nothing, then the rest is good.
    i've looked if i can clear the TXREG first, but my example doesn't run. i tried this (found in thread 1999)

    ASM
    btfss PIR1,4 ; Wait for TXREG to be empty after last byte
    goto $-1 ; Not empty, wait
    ENDASM

    probaply i search at the wrong end...

    thanks for any help
    Last edited by mischl; - 31st August 2005 at 18:16.

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


    Did you find this post helpful? Yes | No

    Default

    The problem is in the Idle mode of your pin before using the first SEROUT. Have a look at it before and after. You'll void the problem by setting your idele mode at the same level.
    Steve

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

  3. #3
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default thanks, works fine

    for interests, fixed the problem by :

    init : high tx1 ' avoid idle mode
    main : serout tx1, t9600, [sendbyte]

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. byte compression
    By Norbert in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th June 2007, 18:04
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47

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