Page 1 of 1

Reset or claer for Pic EUSART Hardware

Posted: Tue Sep 27, 2011 8:21 pm
by Dirk Bubley
Hello together,
Hello Matrix team,

i´m looking for a way to reset or claer the Pic EUSART Hardware.
It would be great if there is a command to clear EUSART in the same way like a MCLR.

Is there a known C-Code command???

BR

Dirk

Re: Reset or claer for Pic EUSART Hardware

Posted: Wed Sep 28, 2011 2:42 pm
by Benj
Hello Dirk,

This code switches off the UART for a 8-bit PIC.

Code: Select all

rcsta = 0;
txsta = 0;
This code switches the UART back on.

Code: Select all

st_bit(txsta, BRGH);
rcsta = 0;
st_bit(rcsta, SPEN); 
st_bit(txsta, TXEN);
st_bit(rcsta, CREN);
Is this the kind of thing you were looking for?

Re: Reset or claer for Pic EUSART Hardware

Posted: Wed Sep 28, 2011 10:01 pm
by Dirk Bubley
Hello Benj,

many thanks for your input and reply!! It looks that your code is working!!

The possibility to switch the USART off and on will make my RS232 interface more robust because now i can patch the data cable during opperation.

I must still do some testing but at the moment it looks very good!!

Will your commands have a influence on the regular RS232 external properties like Baud rate or so on??


BR

Dirk

Re: Reset or claer for Pic EUSART Hardware

Posted: Thu Sep 29, 2011 10:09 am
by Benj
Hello Dirk,

My commands will not effect the RS232 component baud rate but will probably disable the 9-bit mode of operation. If you are using this then let me know and I will add the commands to re-enable it.