Custom data pin for display.
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?
Re: Custom data pin for display.
Re: Custom data pin for display.
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.
Re: Custom data pin for display.
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.
Re: Custom data pin for display.
HENRIIIIIIIIIIIK !!!!
http://www.fakhriramley.com/HIDUP-BE...-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
Re: Custom data pin for display.
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.
Re: Custom data pin for display.
Quote:
Originally Posted by
Jerson
This is perfect. Just I can, I will try this code! Thank you for now!
Re: Custom data pin for display.
It work correctly thank you at all!
Re: Custom data pin for display.
Quote:
Originally Posted by
HenrikOlsson
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.':)
Re: Custom data pin for display.
True story: "I don't see you, you don't see me". This is why you're still alive ardhuru :D