View previous topic :: View next topic |
Author |
Message |
ljunior
Joined: 26 Apr 2011 Posts: 4 Location: Brazil
|
Software Serial |
Posted: Fri Oct 14, 2011 5:32 am |
|
|
Hello,
Is it possible to implement a serial communication thru the usb pins, PIN_C4 and PIN_C5, in PIC18F4550?
Thanks |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Oct 14, 2011 5:38 am |
|
|
I an not familiar with your particular PIC, but using the built in CCS software serial functions you can use whatever pins you want. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Fri Oct 14, 2011 6:14 am |
|
|
gee..one that I can answer ! I'm using the 4550....
Yes, if you're not using the USB peripheral of the PIC, those pins can be used for discrete I/O or software serial uses. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri Oct 14, 2011 11:32 am |
|
|
so is this a SECOND serial port??
and you are (already_using || decline2use)
the superior EUSART on pin c6,7 ??
in ANY application i have ever done
software based serial comm was the DEAD LAST CHOICE. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Oct 14, 2011 12:13 pm |
|
|
You guys should look at the 18F4550 data sheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf
It explains what each pin can do.
Look in the Table of Contents in the Acrobat reader and click on the "+"
to expand this section:
Quote: |
1.0 DEVICE OVERVIEW
|
Then click on the "+" for this section to expand it:
Quote: |
1.3 Details on Individual Family Members
|
Then click on the specific PIC in the family that you want. For example,
we want the 18F4550:
Quote: |
TABLE 1-3: PIC18F4455/4550 PINOUT I/O DESCRIPTIONS |
Then click down the pages until you get to the table for Port C.
Here's the section about pins C4 and C5:
Code: |
Pin Pin
Name Type Description
RC4/D-/VM
RC4 I Digital input
D- I/O
VM I
RC5/D+/VM
RC5 I Digital input
D+ I/O
VP I
|
It shows that when those pins are configured as ordinary PIC pins
(not used for USB), they can only be digital inputs. They can't do output.
This means they can't be used as the Tx pin in a software UART.
But they could be used as the Rx pin. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Fri Oct 14, 2011 12:43 pm |
|
|
well, that's just silly....I'd assumed that Microchip kept the full port as I/O from decades ago and just 'added' internal peripherals as the years went by.Just looking at the pinout diagram isn't enough any more !
With that in mind, a simple 'pop a newer chip in' will NOT work for an upgrade to gain more memory or newer feature.
Sigh...maybe I should have stuck to using the 877..... |
|
|
|