News:

;) This forum is the property of Proton software developers

Main Menu

Hserout vs Hrsout

Started by pjdenyer, Sep 18, 2021, 02:20 PM

Previous topic - Next topic

pjdenyer

Hi,

I hope this is not a dumb question, but can some tell me what is the difference and which is the best to use. Reading the manual, I don't see a difference apart for Hserout requires '[]' and a null terminator.

streborc

I have the same unanswered question.  Both work with the PIC12F1572 that I'm using.  However, neither produces an output without the APFCON (alternate pin function control) register being set.  With the following, I'm able to send serial data to a Newhaven NHD-0220D3Z LCD.

***************************************************************************************
Device = 12F1572

Config1 FOSC_INTOSC, WDTE_OFF, PWRTE_OFF, MCLRE_ON, CP_OFF, BOREN_OFF, CLKOUTEN_OFF
Config2 WRT_OFF, PLLEN_OFF, STVREN_OFF, LPBOREN_OFF, LVP_ON

Declare Xtal = 16    
Declare Hserial_Baud = 9600
Declare HRSOut_Pin = PORTA.4              'either HRSOut or Hserout works here and below

OSCCON = %01111000    ' Set internal osc to 16MHz
ANSELA = %00000000    ' PortA all digital
TRISA = %00000000     ' All pins are outputs
APFCON = %00000100    ' TX function on RA4

main:
HRSOut $FE,$70            'Newhaven command to display its version #
DelayMS 2000              'pause 2 seconds
HRSOut $FE,$51            'clear screen / return home
DelayMS 10                'pause 10 msec
HRSOut "Serial LCD Demo"  'string alpha message
DelayMS 2000              'pause 2 seconds
GoTo main                 'loop

RGV250

Hi,
One might be for backward compatibility?

Bob

streborc

If Les could provide a set of commands compatible with my backwards coding, he is deserving of knighthood!