Problem with HSEROUT/HSERIN


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Problem with HSEROUT/HSERIN

    Yes. Variables are able to hold the value.
    ___________________
    WHY things get boring when they work just fine?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Problem with HSEROUT/HSERIN

    Hi,
    Then I don't know...
    That can't be all of the code can it? Try to reduce the code to the bare minimum which still shows the issue, then post that code.

    I've tried the following on a 18F25K20 running at 64MHz
    Code:
    DEFINE OSC 64
    DEFINE LOADER_USED 1            ' We're using a bootloader.
    DEFINE HSER_RCSTA 90h           ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h           ' Enable transmit, BRGH = 1
    DEFINE HSER_CLROERR 1           ' Clear overflow automatically
    DEFINE HSER_SPBRG 138           ' 115200 Baud @ 64MHz, -0,08%
    
    SPBRGH = 0
    BAUDCON.3 = 1                   ' Enable 16 bit baudrate generator
    
    Name VAR BYTE[25]
    pass var byte
    
    Pause 200
    
    HSEROUT["Program start.",13]
    
    Gain:
    	HSERIN [STR Name\25\"*"] : Pause 250
    	HSEROUT [STR Name,"*"]
    for pass=0 to 24
    	Name[pass]=0
    next pass
    
    Goto Gain
    It seems to work fine using the serial communicator terminal built into MicroCodeStudio...


    /Henrik.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Problem with HSEROUT/HSERIN

    Here is the code, the problem is there:
    Code:
    '-----------------Defines & Includes----------------
    Include "modedefs.bas"
    DEFINE	OSC	20
    
    '------------------------Configuration Fuses-------------
    #CONFIG
        ifdef PM_USED
            device  pic16F877A, xt_osc, wdt_on, lvp_off, protect_off
        else	
    		__CONFIG _HS_OSC & _WDT_OFF & _LVP_OFF & _CPD_ON & _CP_ALL & _PWRTE_ON & _BODEN_ON
       endif
    #ENDCONFIG
    
    
    @ ERRORLEVEL -306			' SUPRESS PAGE BOUNDRY ERROR
    
    '===================================
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_SPBRG 64  ' 19200 Baud @ 20MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    
    '======================================
    '--------------------REGISTERS-------------------------------
    PAUSE 100
    ADCON1=7						' No Analog
    CMCON=7						
    OPTION_REG=128
    TRISA=0 : PORTA=0
    TRISB=0 : PORTB=0	' Enter Button Input
    TRISC=%10000000 : PORTC=0  ' One pin to get data
    TRISD=%10000000 : PORTD=0
    TRISE=0 : PORTE=0
    CCP1CON=0
    
    Name Var Byte[25]
    Pass 	Var Byte
    '--------------------------------------------------------------
    
    Name=0 : Pass=0
    
    Gain:
    	HSERIN [STR Name\25\"*"] : Pause 250
    	HSEROUT [STR Name,"*"]
    For pass=0 to 24
    	Name[pass]=0
    next pass
    Goto Gain
    ___________________
    WHY things get boring when they work just fine?

Similar Threads

  1. need help hserin/hserout cmucam4
    By siyete in forum Serial
    Replies: 3
    Last Post: - 17th December 2012, 22:49
  2. HSERIN and HSEROUT commands
    By ryan in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 6th January 2007, 22:11
  3. HSERIN and HSEROUT problems
    By amindzo in forum General
    Replies: 2
    Last Post: - 31st August 2006, 06:51
  4. Strange problem with the HSEROUT and HSERIN
    By PJALM in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th January 2006, 16:37
  5. Hserin/hserout ?
    By Scott in forum General
    Replies: 6
    Last Post: - 27th April 2005, 23:46

Members who have read this thread : 1

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