PDA

View Full Version : HSEROUT Problems



SergioRM
- 7th April 2005, 15:38
Hi People,

I've been some problems with HSEROUT. I have a 16F628 receiving a string from PC via RS485 half-duplex (using HSERIN without problems).
When a PIC receive the string, it has to send another string to PC like this:

A00000000000000F,

But always its missing the last 2 bytes (0F). If I remove 2 bytes from the string, the problem still occurs...

May I have to clear some register associated with the USART before use HSEROUT or only when using HSERIN?

I have read the datashet lots, melabs achive and I dont know what is happening....

Any tip will be usefull...

Thanks,

Sérgio

Melanie
- 7th April 2005, 15:42
To ensure data is flushed out of the buffers, I always terminate with two characters on the end of my data packet (eg CR,LF - $13,$10).

SergioRM
- 7th April 2005, 15:48
Thanks Melanie, I'll try it...

Regards,

Sérgio

SergioRM
- 7th April 2005, 23:17
Hy Melanie,

Your sugestion works 100%!!!!!

Thank you very much!

Regards,

Sérgio