HSER Problems


Results 1 to 10 of 10

Thread: HSER Problems

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    use HSERIN [CHAR] and HSEROUT[CHAR] may solve few things. And you should DEFINE RCSTA as well... even if by default it's 2400 baud. Not sure how DEFINE LOADER_USED affect the whole thing.

    try...
    Code:
    	DEFINE OSC 4
    	DEFINE LOADER_USED 1
    
    	DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    	DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    	DEFINE HSER_SPBRG 25  ' 2400 Baud @ 4MHz, 0.17%
    	DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    
    
    	Char VAR BYTE
    	LEDB var PORTD.1
    	LEDG var PORTD.2
    	LEDR VAR PORTD.4
    
    main:
    	GOSUB standby
    	LOW LEDB
    	HSEROUT [Char]
    	HIGH LEDG
    	PAUSE 5000
    	LOW LEDG
    	GOTO main
    
    Standby:
    	High ledb
    	HSERIN [Char]
    	RETURN
    
    Error:
    	END
    What do you really want to do with the above? Learn something, or doing something useful?
    Last edited by mister_e; - 1st October 2007 at 21:04.
    Steve

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

Similar Threads

  1. My USART problems..
    By Glenn in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 31st July 2009, 01:00
  2. 2 PWM in 16F690 problems
    By ciendavila in forum mel PIC BASIC
    Replies: 9
    Last Post: - 27th April 2008, 09:03
  3. bootloader Freqout problems
    By handgio in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2007, 13:38
  4. Goto inside a gosub??? Problems...
    By leonel in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th October 2005, 12:17
  5. HSEROUT Problems
    By SergioRM in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th April 2005, 23:17

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