PDA

View Full Version : LCDOUT with custom PINS



Josuetas
- 26th August 2007, 17:07
Hi.

I have a very small project on 16f628 that uses a classic LCD,

Now, due to PCB and PINOUT restrains i need to use the PINs (A6,A7,A0,A1) as data bus for this LCD, that is impossible with the LCDOUT defines, any help on how i cand do this?

Hopefully
PortA.6->D7
PortA.7->D6
PortA.0->D5
PortA.1->D4

Thanks on any help

DJC

Acetronics2
- 26th August 2007, 17:45
Just Use a serial LCD ...

LOL !

Alain

Archangel
- 27th August 2007, 01:31
Hi.

I have a very small project on 16f628 that uses a classic LCD,

Now, due to PCB and PINOUT restrains i need to use the PINs (A6,A7,A0,A1) as data bus for this LCD, that is impossible with the LCDOUT defines, any help on how i cand do this?

Hopefully
PortA.6->D7
PortA.7->D6
PortA.0->D5
PortA.1->D4

Thanks on any help

DJC
Hi Josuetas,
If I get what you are asking, No !
The 4 data lines of the LCD must use either the 4 lower or the 4 upper lines of the given port, example:


Define LCD_DREG PORTB ' Uses port B on Ports B 4,5,6,7
Define LCD_DBIT 4

OR:

Define LCD_DREG PORTB ' uses Port B on Ports B 0,1,2,3
Define LCD_DBIT 0

OR:

Define LCD_DREG PORTA ' same comments as above except Port A
Define LCD_DBIT 4

OR:

Define LCD_DREG PORTA
Define LCD_DBIT 0



The E bit and the RS bit can go pretty much wherever you want

Josuetas
- 28th August 2007, 13:48
Thanks for your replies to both of you. BUT there are no serial LCD`s around here, just the classic LCDOUT type LCD, AND i know LCDOUT defines the data port in one port, not in two.

BUT AGAIN :D

i have to use this pinout to control my LCD, so LCDOUT just doesnt work because the pins that i wanīt to use are in ports A and B not just in one, and not in order.

What i expect?
Some ideas as how to use LCDOUT with any pin for the data port
OR
Some code showing how the LCD is managed to avoid using LCDOUT directly and rewrite my own LCD subs.

Thanks for your concerns

mackrackit
- 28th August 2007, 14:21
You could build your own serial back-pack.

http://www.picbasic.co.uk/forum/showthread.php?t=4972&highlight=serial+display

Darrel Taylor
- 28th August 2007, 14:27
Well, at one point I was working on exactly what you want. I got sidetracked, and it never got finished.

However, I think it's still a good starting point for you. But we may need to work out a couple details.

Check out this post...
http://www.picbasic.co.uk/forum/showthread.php?p=22065

At the bottom of that post is a way to hookup the LCD to any Pins.
The virtual port program is in post #14

The original intention was to be able to tie it in with LCDOUT so that it would be transparent to the user. I did get it working at one point, but then messed it up trying to make it usable for everyone. Never did finish it

But as it is, it does drive an LCD on any pins. You just have to send the data to it manually.
<br>

Josuetas
- 28th August 2007, 14:35
You could build your own serial back-pack.



Thanks but again a serial LCD is not the answer, it is more expensive, much more, it can cost up to 5 dollars each of the modules mentioned in your post. In this case i DO have the pinout needed to control my classic LCD.

mackrackit
- 28th August 2007, 14:46
Thanks but again a serial LCD is not the answer, it is more expensive, much more, it can cost up to 5 dollars each of the modules mentioned in your post.

HUH, the post I linked to is a discussion for building, not buying. Maybe it would cost $5 to build one though, depends on what you have laying around.


In this case i DO have the pinout needed to control my classic LCD.
My misunderstanding, thought the problem was you do not have the pins needed?
Oh well, good luck.

Josuetas
- 2nd September 2007, 17:06
Hi, i didnt reply because i was expecting the PCB, it was late so i got to work just today.

Darrel Thanks for your reply, i have been trying to figure your suggestion, i get the virtual port, but in the link

http://www.picbasic.co.uk/forum/showthread.php?p=22065

the example to use it to this specific case uses a HighJack.bas include that isnt posted anywhere.

Now if i get it well The HighJack.bas file must be used to replace a subroutine for a self made one, wich DO is on the post.

Now summary: The HighJack will replace LCDOUT for a selfmade, this LCD self made uses virtual PORT to write to the device.... If i am wrong please correct me.

Finally i will need HighJack.bas ;)

On the other hand, is it really this hard to work with LCD`s isnīt there a simple routine that i can change just to make LCDOUT? which are the LCD commands?, i have never seen them.

Thanks

DJC

Darrel Taylor
- 2nd September 2007, 22:36
Hi Josuetas,


On the other hand, is it really this hard to work with LCD`s isnīt there a simple routine that i can change just to make LCDOUT?
It really depends on what you need to do with the LCD.

If you just want to send individual characters to the LCD, you can use the program shown in the other thread, and by removing the HighJack reference and changing 1 other line, it will do exactly that. Which means the answer to the question is ... No it's not difficult to work with LCD's.

But that means you can't use PBP's LCDOUT statement. No DEC, HEX, STR, or anything else that goes with LCDOUT.

The hard part, is making a "custom LCD Driver" tie into PBP's LCDOUT statement so that it's completely transparent to the user. You would just use LCDOUT like you normally would.

Like I mentioned earlier, I have it working here. But I still haven't got it to where I can release it as "Working in all situations".

I'm sure I can get it working for you, but I want to do some testing here first. So I need to know EXACTLY what your setup is.

Originally you said 16F628.
Is that the standard or "A" version?

Are these correct?
Hopefully
PortA.6->D7
PortA.7->D6
PortA.0->D5
PortA.1->D4

And what about RS and E ?
<br>

Darrel Taylor
- 3rd September 2007, 05:42
OK, too slow.

You're probably in another timezone sleeping away..

Got it figured out.

See this ...

LCD_AnyPin.pbp
http://www.picbasic.co.uk/forum/showthread.php?t=7038

HTH,

Josuetas
- 4th September 2007, 01:13
I am sorry for being late in my answer :(

Thanks for your help Darrel, i will watch it right now.