Hserin, 1st character always lost!


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117

    Default Hserin, 1st character always lost!

    I have used many time command Hserin, but just now I noticed that everytime the first incoming character is lost.

    So a simple test code was compiled to prove this:

    INCLUDE "C:\PBP\MODEDEFS.BAS"
    DEFINE OSC 4

    @ __config _XT_OSC & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _CP_OFF

    intcon=%11000000 'Enable USART interrupts or else 0
    t1con=0'%00110001 'Enable Timer1,prescaler/8,ON
    pie1=%00100000 'Enable Peripheral Timer1,RCIE

    trisa=1:trisb=1:trisc=128:trisd=0:trise=0
    PORTA=0:PORTB=0:PORTC=0:PORTD=0:PORTE=0

    OPTION_REG=%11110001

    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h '9600 baud rate, BRGH=1
    DEFINE HSER_BAUD 9600
    DEFINE HSER_SPBRG 25
    DEFINE HSER_CLROERR 1

    adcon0=%10000001
    adcon1=%10001110

    i var byte

    loop:
    hserin [i]:hserout [i]
    goto loop

    end

    The result is that indeed the first incoming is always lost.

    Did anyone noticed that and how is it overcomed?

    Ioannis
    Last edited by Ioannis; - 2nd June 2007 at 12:24.

Similar Threads

  1. HSERIN and STR - character encoding
    By boban in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 13th August 2008, 17:36
  2. Replies: 6
    Last Post: - 30th June 2008, 16:33
  3. HSERIN each character cost 3 pgm words
    By boban in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 7th April 2008, 16:49
  4. Hserin problems
    By nicjo in forum Serial
    Replies: 0
    Last Post: - 27th November 2006, 10:16
  5. Hserin
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th November 2004, 15:42

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