Thanks Edward, sequential pins is not a problem. Portb is wide open. I was not sure about clocking. If I use portc.0 for the clocking output, can I also use that pin to clock a peripheral in serial mode.
The Geezer
Thanks Edward, sequential pins is not a problem. Portb is wide open. I was not sure about clocking. If I use portc.0 for the clocking output, can I also use that pin to clock a peripheral in serial mode.
The Geezer
http://www.geocities.com/SiliconVall.../lcd/intro.htm
if portb is wide open than just use 6 pins from that port to control the lcd.
PIC | LCD
-----------------------------
portb.0 to D4
portb.1 to D5
portb.2 to D6
portb.3 to D7
portb.4 to RS ' 0 mean you are sending intructions, 1 means ur sending asci
portb.5 to E 'tells the lcd you want it to read the 4 data pins (high-low trans)
'the above is not code
if you can do that then ignore the below.
you should be able too but keep in mind that both the LCD and your other serial device will have to be syncronized. so if you pulse portc.0, to control the serial device, the lcd will interprete that as you sending it a command and will "read" what is on its data lines as data. ( so you could send a %0000, unitentially, to the lcd.
I WOULDNT RECOMMEND IT unless your sure it will work cause the clock timing is very important in serial control, and usally run at high speeds. the lcds "clock" isnt really a clock. it is more of an "read what is on the port" signal. and the lcd is only updated as you tell it.
a workaround coul be this:
1. do your serial stuff using the portc.0 as clock.
2. the lcd might display weird stuff while this is happening.
3.after serial stuff done, clear the lcd with commands
4. do the lcd stuff.(but this could mess up ur serial device communication)
another could be this if you only need to use ur serial device early in the program, then dont initialize your lcd till its done.
1.do serial stuff
2. once serial stuff is done, init the lcd
3. do lcd stuff(as i said above it could mess with the serial device still)
what is your serial device? eeprom?
if a hardware change is still posible then do some research on a digtal latch, i think thats what it is. bassically its a device that allow you to "disconnect" 8 isolated leads with just 1 pin. basically i could "hand over" a port for another device by isolating the primary device with a digital latch. it may at first seem like youll need more ports but actually is less becuase you can get 16 outputs from 10 pins on the pic (8 for the data + 1 to make the latch A open or close + 1 for latch B) ill try and get a data sheet on the device im thinking of. ok its not called a latch, i know ive used one but cant remeber. maybe somone else will know.
i drew a picture of the "latching" device. i only drew 4 pins per latch for simplicity. also get creative maybe run the control bit for latch 2 thru an inverter making the schematic only requireing 9 bits
Last edited by EDWARD; - 8th May 2005 at 10:11.
Thanks Edward,
The serial port need is to output to a digital to analog converter (pot). Both it and the lcd will be changing constantly. All I really need is another clocking pin for the lcd, and I can put the lcd on portb. There is no clocking pin on portb of the 16F877A. One more clocking pin will solve all my problems.
The Geezer
the lcd's E bit is not an actual clock remember. there is no signal at all going to the lcd when its not be "updated", like it doesnt need a constant clock signal to keep the same stuff on the screen.
you just need 6 standard I/O ports to run the lcd.
i might not fully understand the operation of your device, but if the lcd can be updated after the the serial device id just use the setup below. and have the lcd sub run every time the serial sub is done.
PIC | LCD
-----------------------------
portb.0 to D4
portb.1 to D5
portb.2 to D6
portb.3 to D7
portb.4 to RS ' 0 mean you are sending intructions, 1 means ur sending asci
portb.5 to E 'tells the lcd you want it to read the 4 data pins (high-low trans)
im didnt look at the datasheet of your pic, so i hope this works for ya bud.
'holla
Bookmarks