LCDOUT with custom PINS


Closed Thread
Results 1 to 12 of 12
  1. #1

    Default LCDOUT with custom PINS

    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

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Lightbulb

    Just Use a serial LCD ...

    LOL !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Josuetas View Post
    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:
    Code:
    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
    Last edited by Archangel; - 27th August 2007 at 01:33.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4


    Did you find this post helpful? Yes | No

    Default ok... I know That... Alll

    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

    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

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You could build your own serial back-pack.

    http://www.picbasic.co.uk/forum/show...serial+display
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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>
    DT

  7. #7


    Did you find this post helpful? Yes | No

    Default No real REASON for that

    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.
    Last edited by Josuetas; - 28th August 2007 at 14:45.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Josuetas View Post
    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.
    Dave
    Always wear safety glasses while programming.

  9. #9


    Did you find this post helpful? Yes | No

    Default Now i am working.... late?

    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
    Last edited by Josuetas; - 2nd September 2007 at 17:18.

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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?
    Code:
    Hopefully
    PortA.6->D7
    PortA.7->D6
    PortA.0->D5
    PortA.1->D4
    And what about RS and E ?
    <br>
    DT

  11. #11
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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,
    DT

  12. #12


    Did you find this post helpful? Yes | No

    Default Sorry for the daley

    I am sorry for being late in my answer

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

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  2. need help in coding..
    By daphne8888 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 19th March 2008, 07:31
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts