LCDOUT custom commands - how to?


Closed Thread
Results 1 to 40 of 69

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Yes you can!

    Quote Originally Posted by flotulopex
    Mister_e don't worry, your eyes are absolutely fine ;-)

    I'm using ICProg to program the µC and the fuses are set in there since I can't pass this kind of settings from PBP.
    Hi flotulopex, I use IC PROG and I pass the config fuse data to it from code always. Which assembler are you using PBP or MPASM? Also what osc speed?
    Code:
    for MPASM try
    @MyConfig = _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _LVP_OFF 
    @MyConfig = MyConfig  & _CP_OFF & _BODEN_ON & _DATA_CP_OFF
    @ __config  MyConfig
    
    for PBP try
    @ DEVICE pic16F88, HS_OSC
    ' Set Oscillator Fuse in Programmer to high speed make XT for low speed
    @ DEVICE pic16F88, WDT_ON
    ' Watchdog Timer
    
    @ DEVICE pic16F88, PWRT_ON
    ' Power-On Timer
    
    @ DEVICE pic16F88, MCLR_ON 
    ' Master Clear Options (Internal)
    
    @ DEVICE pic16F88, BOD_OFF
    ' Brown-Out Detect
    
    @ DEVICE pic16F88, LVP_OFF
    ' Low-Voltage Programming
    
    @ DEVICE pic16F88, CPD_OFF
    ' Data Memory Code Protect
    ' Set to CPD_OFF for Development Copy
    ' Set to CPD_ON for Release Copy
    
    @ DEVICE pic16F88, PROTECT_OFF
    Also make sure to define your oscillator if you do not use default 4 mhz
    JS
    Last edited by Archangel; - 25th November 2006 at 09:00.

  2. #2
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Time to go back to basics I think

    There are basically two things that could be stopping you display from working.

    1. a problem with the PIC

    2. a problem with the display.


    To test 1....

    I would assign an entire 8 bit port for the LCD eg PortB (just for test purposes) and connect LEDs to each bit. Also put LEDs on the pins of another port that you will use for the control lines.

    Have a count run from 0-255 and output that to port B and observe that the LEDs count up correctly.

    Likewise output all possible combinations on the pins you use for the control lines just to ensure that all your output pins are correctly configured and can successfully light the LEDs.


    to test 2......

    Once you know that you PIC is capable of driving all the required lines, connect up the LCD display in 8 bit mode and then try all the commands to get it working. Once you have it working it should be simple to change to 4 bit mode.

    As far as I can see the only difference between 4 and 8 bit mode is in the initialisation which tells the LCD how it is connected. All subsequent commands should be the same, the only difference being that instead of sending a byte you have to send two nibbles instead which obviously takes twice as long.

    I have had a further thought about something that caught me out a few weeks ago when changing to a different display. I didnt have the R/W line connected to the PIC, but I also didnt have it tied to anything either. The origianl display must have had some form of internal pullup/pulldown resistor as it didnt mind about the floating pin but the new display would not do anything until correctly terminated.

    The second datasheet you mentioned for the actual controller chip has full examples of initialising in 8 and 4 bit mode so all the actual values you need are listed there. Ignore the fact that it is written in 8051 assembler just use the values in your PBP code. Being 44780 compatable means that it should work fine with LCDout so my bet is a misconfiguration of the PIC or a wiring fault unless you are really unlucky and have killed a piece of hardware.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Fuses!!!! yes, it works really :-)

    Wow Joe S!!

    Yes it works; I'm very surprised indeed. I was told it was not possible with ICProg.

    I'm using PBP. Where did you find the correct syntax to use for every fuses?



    Keith,

    You're right. Let's go on with method. I'm starting to check as you suggest. Will come back when done.
    Roger

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default PIC tested = ok

    Hi Keithdoxey,

    I tested the PIC with my logic probe and hope doing so is fine (please let me know if it is not a good practice - I'm not an electronician).

    My PIC looks okay so far.

    Going now to the second step: check the LCD.

    Come back later.
    Roger

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex
    I'm using PBP. Where did you find the correct syntax to use for every fuses?
    If you're using PM, open m16f88.inc file in c:\pbp\inc folder, they're located at the top.

    If you're using MPASM, open p16f88.inc file in C:\Program Files\Microchip\MPASM Suite folder. They're located at the bottom.

    There's a huge thread Here about that.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Got so much to learn today...

    Thanks Mister_e,

    Fuse config is now clear to me ;-)

    Back to my display, I did what keithdoxley suggested but still it's not working.

    Finally, I connected my usual display on the PIC with an 8 bit data-bus. It works fine so, for sure, the PIC is not the problem.

    I have contacted ELECTRONIC ASSEMBLY and asked for more informations. I still can't believe I would have broken both displays...

    For normal use, the display must be set in Read or Write (R/W)?

    One last thing about the contrast control: would be the syntax to change the contrast's setting "LCDOUT $FE, $74"? According to the table (Initialise_LCD.bmp) in post #10, it should but how to change the amount of contrast???
    Last edited by flotulopex; - 25th November 2006 at 14:19.
    Roger

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Thanks Mister_e,

    Fuse config is now clear to me ;-)
    You're welcome, It's always handy to have theses in your code.

    One last thing: for normal use, the display must be set in Read or Write (R/W)?
    Unless you want to read from your LCD (Wich i still don't understand why anyway) you should set the PIN to 0, low, gnd.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default LCD Write?

    Yes, really handy. Thanks a lot again.

    I would appreciate to find some more explanations on how to read (understand) and write to the display the configuration commands such as LCDOUT $FE, xxx.

    Merci encore.
    Roger

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