CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Software Serial

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ljunior



Joined: 26 Apr 2011
Posts: 4
Location: Brazil

View user's profile Send private message

Software Serial
PostPosted: Fri Oct 14, 2011 5:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 14, 2011 5:38 am     Reply with quote

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: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Oct 14, 2011 6:14 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Fri Oct 14, 2011 11:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 14, 2011 12:13 pm     Reply with quote

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: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Oct 14, 2011 12:43 pm     Reply with quote

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.....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group