View previous topic :: View next topic |
Author |
Message |
Bart
Joined: 12 Jul 2005 Posts: 49
|
Hardware RX/TX and SDO at same time on 18F4550 ? |
Posted: Tue Sep 27, 2005 1:53 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 27, 2005 2:30 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Bart
Joined: 12 Jul 2005 Posts: 49
|
|
Posted: Tue Sep 27, 2005 2:41 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 27, 2005 2:59 pm |
|
|
USB is disabled by default, upon power-up, so you should be able
to use those pins for a soft UART. |
|
![](templates/subSilver/images/spacer.gif) |
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Sep 27, 2005 3:19 pm |
|
|
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 !!!
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 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 27, 2005 3:26 pm |
|
|
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](images/smiles/icon_mrgreen.gif) |
|
![](templates/subSilver/images/spacer.gif) |
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Sep 27, 2005 3:38 pm |
|
|
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)".
Humberto |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 27, 2005 3:46 pm |
|
|
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](images/smiles/icon_mrgreen.gif) |
|
![](templates/subSilver/images/spacer.gif) |
Bart
Joined: 12 Jul 2005 Posts: 49
|
|
Posted: Wed Sep 28, 2005 12:42 am |
|
|
Hey guys,
Thanks for the "Relaxed moment/coffee talk" and also for the solution.
Bart _________________ I like Skype (www.skype.com), my username is BplotM |
|
![](templates/subSilver/images/spacer.gif) |
|