Reset or claer for Pic EUSART Hardware

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times

Reset or claer for Pic EUSART Hardware

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Reset or claer for Pic EUSART Hardware

Post 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?

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times

Re: Reset or claer for Pic EUSART Hardware

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Reset or claer for Pic EUSART Hardware

Post 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.

Post Reply