PDA

View Full Version : 18f4550 portc.4 and portc.5 problem



pcaccia
- 11th October 2008, 21:38
I must use the ports 18f4550's C.4 and C.5 only for input TTL. (And not as USB D + D-)
Reading the datasheet you can use these ports in input TTL disabling the USB via the register UCON.3. I put into the program this command but the ports C.4 and C.5 not read the data input.
I tried to read again the datasheet and look for information on the Internet .... but I have not found anything.
Is there anyone who can help me?
Sorry for my english!
Thank you
Paolo

skimask
- 12th October 2008, 02:55
And did you also disabled the onchip transceiver? UCFG<3>=1?

Darrel Taylor
- 12th October 2008, 03:03
The 4550 powers up with the USB module turned OFF.
And unless you have included USB statements in your program, it'll stay that way.

Whenever the module is OFF, the pins are in data INPUT mode. They cannot be set to output, because there are no corresponding TRIS bits.

If you can't read those pins, you've probably got something external going on.

pcaccia
- 12th October 2008, 07:38
.....and now all work perfectly!

The problem is the trasceiver is on......UCFG.3 = 1 solve all the problems!

I read the datasheet many time...but the solution is always..IN THE NEXT PAGE!

I take this opportunity to ingratiate your good work. I don't write to much on this forum, but I read carefully because I always (or almost) find the solution to my problems!
Darrel thanks for your excellent routines and your presence in this forum, skymask thanks for the excellent advice from this forum.

Paolo

skimask
- 12th October 2008, 07:42
Darrel thanks for your excellent routines and your presence in this forum
You see that everyday...


skymask thanks for the excellent advice from this forum
Ya don't see THAT everyday! :D

Glad I could help in my own 'special' way...

Darrel Taylor
- 12th October 2008, 08:15
Hmmm, perhaps I need to spend some more time in the USB section.

I thought setting UCFG.3 to "External transceiver" would wipe out ...

RB2 - RB2/AN8/INT2/VMO
RB3 - RB3/AN9/CCP2(1)/VPO
RC1 - RC1/T1OSI/CCP2(1)/UOE

pcaccia
- 12th October 2008, 10:26
In my project all the pins VMO / VPO / UOE are used as digital outputs.
I test them...and with UTRDIS = 1 (UCFG.3 = 1) I can use in TTL input RC4 and RC5 and in the same time I can use RB2 RB3 and RC1 as output...(RC1 transmit serial data at 38400Bps, RB2 AND RB3 send command to activate/deactivate rele').
If you think may be interesting to test other possibilities...tell me something about. I will do it!

Paolo

Darrel Taylor
- 12th October 2008, 20:52
In my project all the pins VMO / VPO / UOE are used as digital outputs.
I test them...and with UTRDIS = 1 (UCFG.3 = 1) I can use in TTL input RC4 and RC5 and in the same time I can use RB2 RB3 and RC1 as output...(RC1 transmit serial data at 38400Bps, RB2 AND RB3 send command to activate/deactivate rele').
If you think may be interesting to test other possibilities...tell me something about. I will do it!

Paolo

Nope, that's Great information!

I'll see if I can find a few extra brain cells to store it in.

I'll put a mark on the chalkboard for skimask too. :)
<br>