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 support@ccsinfo.com

Hardware RX/TX and SDO at same time on 18F4550 ?

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



Joined: 12 Jul 2005
Posts: 49

View user's profile Send private message

Hardware RX/TX and SDO at same time on 18F4550 ?
PostPosted: Tue Sep 27, 2005 1:53 pm     Reply with quote

Hello,

As on a 16F877 the RX (pin26) TX (pin25) and SDO (pin24) are on separated pins,
on the 18F4550 they are RX and SDO on the same pin26, TX on pin25

So, my question is :
Can I use RX/TX and SDO/SDI/SCK at the same time ?

Eventualy I don't need the RX.
Question is they :
can I use the TX only (what do I specify for the RX pin then in CCS ?)
(so pin 26 SDO becomes available for my MMC card)

Thanks.
_________________
I like Skype (www.skype.com), my username is BplotM
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 2:30 pm     Reply with quote

The data sheet doesn't show that the hardware USART can be split.
It's all or nothing:
Quote:
bit 7 SPEN: Serial Port Enable bit
1 = Serial port enabled (configures RX/DT and TX/CK pins as serial port pins)
0 = Serial port disabled (held in Reset)

If you want to use Tx only, you can do so, but it will have to be
a software UART.
Bart



Joined: 12 Jul 2005
Posts: 49

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 2:41 pm     Reply with quote

Can I use
pin 24 RC5/D+/VP and
pin 25 RC4/D-/VM
for the software UART if I don't need the USB ?
(so : #use rs232(baud=9600, xmit=PIN_C5, rcv=PIN_C4,stream=MODEM)
Do I need more to specify in CCS no to activate the USB ?
Thanks
_________________
I like Skype (www.skype.com), my username is BplotM
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 2:59 pm     Reply with quote

USB is disabled by default, upon power-up, so you should be able
to use those pins for a soft UART.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 3:19 pm     Reply with quote

You can use any I/O if you want to use Tx only with software UART as PCM Programmer
told you, but not RC5(Pin24) wich is only Digital Input.
You can use RC6(Pin25) but as you are going to use it as an output be aware that
this is an open colector type and needs a resistor tied to +5V.

PCM Programmer let me correct you once in five years !!! Mr. Green
This is true in 16F87x series.
Quote:

bit 7 SPEN: Serial Port Enable bit
1 = Serial port enabled (configures RX/DT and TX/CK pins as serial port pins)
0 = Serial port disabled (held in Reset)


but in 18F series
Quote:

bit 5 SSPEN: Synchronous Serial Port Enable bit
1 = Enable Serial port and configures SCK, SDO, SDI and SS as serial port pins.
0 = Disables Serial port and configures this pins as I/O pins.
When enabled, these pins must be properly configured as input or outputs.



Best wishes,

Humberto


Last edited by Humberto on Tue Sep 27, 2005 3:31 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 3:26 pm     Reply with quote

Thank you for correcting me. I didn't move my eyes over to
the right side of the overview section and see the "Digital Input".
I should learn to read the data sheet better (or drink more coffee). Mr. Green
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 3:38 pm     Reply with quote

Quote:

I should learn to read the data sheet better (or drink more coffee).


I guess almost the same frequently...
"I should learn to read the data sheet better (or drink less wine)". Shocked

Humberto
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 27, 2005 3:46 pm     Reply with quote

This morning when I came in, I only put half a scoop of coffee
into the coffee maker because I wanted to cut back on it. Then
I later said to myself, "Gee, I feel tired this morning...".
So now I know not to do that. Mr. Green
Bart



Joined: 12 Jul 2005
Posts: 49

View user's profile Send private message

PostPosted: Wed Sep 28, 2005 12:42 am     Reply with quote

Hey guys,

Thanks for the "Relaxed moment/coffee talk" Laughing Wink and also for the solution.

Bart
_________________
I like Skype (www.skype.com), my username is BplotM
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