PDA

View Full Version : Custom data pin for display.



Ziko87
- 15th July 2011, 07:24
Traduzione da italiano verso inglese

Hi,
I'm translating code from C to PicBasic Pro, and I ran into a problem. Hardware requirements for a diaplay he has the following pin:

DB0 -> RB1
DB1 -> RB2
DB2 -> RB3
DB3 -> RB4

In C this is not a problem, but in PicBasic I saw that you can only set the pin to 4 or 0 for the data. Is there a way to customize every single bit?

Jerson
- 15th July 2011, 07:35
Can this help you?

http://www.picbasic.co.uk/forum/showthread.php?t=7038&highlight=anypin

HenrikOlsson
- 15th July 2011, 07:38
On some PICs RB4 is open drain meaning it can only sink current not supply. If you can show me the C compiler that can change that I'll be impressed ;-)

Look at the datasheet for the PIC you're using, it will tell you if RB4 is open drain or push-pull output. If it's push-pull you'll be fine otherwise it might be enought to add a pullup resistor.

/Henrik.

HenrikOlsson
- 15th July 2011, 08:33
Sorry, early in the morning i here..... It's RA4 that's open drain on some PICs - not RB4. So I can't see any reason for RB4 not working for you.

mister_e
- 15th July 2011, 08:45
HENRIIIIIIIIIIIK !!!!

http://www.fakhriramley.com/HIDUP-BERANI-UNTUK-GAGAL-IMAGE/quit-smoking-with-Uncle-Sam.jpg


PBP allow data bit to start from PORTx.0 OR PORTx.4. Jerson's suggestion's right.

However, a slight modification to the whole code should be easy to suit PBP requirement... but we don'gt know anything about the actual project... so

HenrikOlsson
- 15th July 2011, 09:25
Ahh, I (mis)read the question as in PicBasic I saw that you can only set pin 4 to 0 for the data.

Have never smoked in my life but apparently I might as well have been since not doing it doesn't seem to help....

Sorry for any confusion I've brought upon the subject.

Ziko87
- 15th July 2011, 14:11
Can this help you?

http://www.picbasic.co.uk/forum/showthread.php?t=7038&highlight=anypin

This is perfect. Just I can, I will try this code! Thank you for now!

Ziko87
- 19th July 2011, 09:47
It work correctly thank you at all!

ardhuru
- 19th July 2011, 10:06
Have never smoked in my life but apparently I might as well have been since not doing it doesn't seem to help....



'I have never looked left, or right, crossing the street; and, I'm alive; Conclusion: It must be dangerous to look to your left and right, before crossing.':)

mister_e
- 19th July 2011, 14:12
True story: "I don't see you, you don't see me". This is why you're still alive ardhuru :D