Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4746

Problem with HSERIN

$
0
0
Hi, I have the following defines added from PICMUltiCalc:

Code:

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

I am receiving the following data: 'Home*'

and I am trying to catch it in the following statement:
Code:

        HSERIN [STR Name\25\"*"]
Then to check what is in Name (25 byte variable) I am doing :
Code:

HSEROUT ["Name=",STR Name,13,10]
What I am getting out is this:
Code:

Name=Hom²åHom²åHom²åHom¥åHområ  ' Attempt 1
Name=Hom:åHomZåHomUþHom8åHom¸ù
Name=Hom(åHom¬ùHomZåHomLùHomZå
Name=HomYåHomœùHom:åHomŒùHomˆù ' Attempt 5

As you can see that it is not capturing the data properly, I also have to send 'Home*' like 5 times as it is not getting the data properly and it is filling the whole 25 byte array. Is there something wrong with the settings? Thanks

Viewing all articles
Browse latest Browse all 4746

Trending Articles