Software UART

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Software UART

Post by Coccoliso » Mon Jun 23, 2014 12:40 pm

Hello.
Question about SetMode, from help:

Code: Select all

sub SetMode(pMode as byte)

pMode - UART Mode. Can be umTrue, umInverted, umOpen, umOpenTrue, umOpenInverted. 
Set the UART mode. By default, mode is set to umInverted.
umInverted is the default..
in this mode the Software UART works like the standard MCU USART or what else for the same signals as polarity?
Thanks.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Software UART

Post by Jerry Messina » Mon Jun 23, 2014 1:31 pm

Setting the mode to 'umTrue' will make the signals work like the standard USART peripheral, where the TX pin idles high.

Are you sure you really want to use the software UART? All of the timing is done using software delays, so TX usually works "ok", but RX almost never works.

User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Re: Software UART

Post by Coccoliso » Tue Jun 24, 2014 11:26 am

OK Jerry.
The MPU USART is used to directly drive an RS232 TTL GSM module.
I want only debug using Software UART and wait only some small responses from MPU.
So all right by setting the Software UART mode to "umTrue".

Thanks.

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Re: Software UART

Post by Jon Chandler » Tue Jun 24, 2014 1:07 pm

I often use the software UART to read debug-type output from the micro; it usually works ok for output but it can cause problems with certain routines. Not Quite Trivial – A Tip For Using The Software UART With The PICkit 2 shows how to configure the UART so you can read results using the PICkit 2 UART Tool connected to the ICSP connector.
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/

User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Re: Software UART

Post by Coccoliso » Wed Jun 25, 2014 12:11 pm

Great suggestion,
exactly what I want, no other connector to add :D .. thanks Jon

Post Reply