PDA

View Full Version : LCD port bit choices



rossfree
- 2nd September 2006, 11:27
Hi all,

Much of the electronics work I do is by example... I'm a mechanical guy by trade and I'm designing my second circuit board. Scarry huh?

That said... I'm trying to lay out circuits for a 16f876. I'd like to use portc for a six wire hookup for an LCD display. Most examples I find show the four data lines connected to the upper for bits of a port such as RC7, RC6, RC5, RC4. But TX and RX are on the upper two bits of portC and I'd like to use those for in-circuit programming via max232 and bootloader.

The lines of code (I have seen) used to set up the ports for LCD use in PicBasic Pro do not appear to point to any particular port bits (that I've found). And believe me I've looked.

I am trying to keep portB open for other stuff and portA is being used for analog inputs.

Can someone please point me to the information I am looking for. Or at least tell me if I am on the right track.

How do I tell the processor and PicBasic Pro which individual port BITS I am connecting my six wire LCD to on a 16f876?

I hope this wasn't too stupid a question. :-P

Many thanks,

Ross

Dave
- 2nd September 2006, 12:46
rossfree, As long as you can have 4 i/o port pins in a row starting at portx.0 or portx.4 then you have got it. The control pins can be placed on any of the other i/o pins. This is in the manual.....

Dave Purola,
N8NTA

DynamoBen
- 2nd September 2006, 15:12
Dave I'm with you in this "problem." The answer you received from rossfree is correct. The data lines need to start at 0 or 4 on one of the three ports. RS and E can go anywhere.

I too have a project using the USART, analog inputs, external interrupt, and much of port B. I ended up using PortB.4-7 for the datalines, PortB.3 for E, and PortC for RS. When I laid out the PCB this kept everything on one layer w/o overlap (vias). BTW I'm also using CCP1 to control contrast via PWM.

Hope this helps. :)

rossfree
- 3rd September 2006, 10:22
Thanks guys,

That clears things up. And I'll get back into that manual.

Thanks again!

Ross