no text on LCD


Closed Thread
Results 1 to 31 of 31

Thread: no text on LCD

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    the schematic is in the pic below, the only difference in my circuit is that i am using a 4 MHZ crystal instead of 32khz, i have compensated for this in my code, correct me if i am wrong.

    can some one please compile a code or send me a hex file to try.
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Sorry......

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    I'm not that experienced enough to resolve this issue, especially as the code is assembly and not PicBASIC pro, but looking at the schematic it shows the values for the crystal capacitors being 68pf. If you look at the datasheet for then 16F84 ( http://ww1.microchip.com/downloads/e...Doc/30430c.pdf ) it states in table 8-1 that for a 4 MHz crystal the preferred values are 15pf - 33pf. Maybe having the higher values which are suitable for Khz timing xtals does not suit the PIC and its not actually running ?

  4. #4
    Join Date
    Jun 2007
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    the crystal seems to be timing as i have checked on an oscilloscope

    how is pic basic pro different from what i am doing?
    and is it easier to learn?

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


    Did you find this post helpful? Yes | No

    Default

    Easier with PicBasic Pro ... yes indeed...
    Code:
        '
        '    LCD setup
        '    =========
    DEFINE LCD_DREG PORTB     ' LCD data port
    DEFINE LCD_DBIT 0         ' LCD data starting bit
    DEFINE LCD_RSREG PORTA    ' LCD register select port
    DEFINE LCD_RSBIT 1        ' LCD register select bit
    DEFINE LCD_EREG PORTA     ' LCD enable port
    DEFINE LCD_EBIT 2         ' LCD enable bit
    DEFINE LCD_BITS 4         ' LCD data bus size
    DEFINE LCD_LINES 2        ' Number lines on LCD
    DEFINE LCD_COMMANDUS 2000 ' Command delay time in us
    DEFINE LCD_DATAUS 50      ' Data delay time in us
    
    
    LCDOUT "HELLO WORLD"
    There's still some mistake in your code so far... not sure it's working @32KHz anyways

    V0 to to GND? not sure, should be connected to a POT wiper or PWM driven or voltage divider.
    Last edited by mister_e; - 19th June 2007 at 00:18.
    Steve

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

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The posted TXT is the HEX compiled version of the program below. Download it, rename is as HEX (this forum doesn't permit HEX extensions on attachments at this time), and stuff it into your PIC. It assumes your PIC is running at 4MHz.

    Code:
    	'
    	'	LCD Test Program
    	'	================
    
    	'
    	' 	PIC Defines
    	' 	-----------
    	@ DEVICE pic16F84, XT_OSC
    		' System Clock Options	
    	@ DEVICE pic16F84, WDT_ON
    		' Watchdog Timer
    	@ DEVICE pic16F84, PWRT_ON
    		' Power-On Timer
    	@ DEVICE pic16F84, PROTECT_OFF
    		' Program Code Protection
    
    	'
    	'	Hardware Defines
    	'	================
    		'
    		' 	LCD Display
    		'	-----------
    		'	Don't forget to GROUND D0-D3 on LCD.
    		'
    	Define LCD_DREG PORTB			' Port for LCD Data
    	Define LCD_DBIT 0			' Use lower 4 bits of Port
    	Define LCD_RSREG PORTA			' Port for RegisterSelect (RS) bit
    	Define LCD_RSBIT 1			' Port Pin for RS bit
    	Define LCD_EREG PORTA			' Port for Enable (E) bit
    	Define LCD_EBIT 2			' Port Pin for E bit
    	Define LCB_BITS 4			' Using 4-bit bus
    	Define LCD_LINES 2			' Using 2 line Display
    	Define LCD_COMMANDUS 2000		' Command Delay (uS)
    	Define LCD_DATAUS 50			' Data Delay (uS)
    		'
    		'
    		'	Confidence LED
    		'	--------------
    		'	This LED will BLINK continuously to prove your program is running
    		'	and will verify your oscillator/xtal is good.
    		'	Connect LED either...
    		'	(a) Anode to Vdd (+5v) via 330R Resistor and Kathode to pin A0
    		'	or (b) Anode to pin A0 via 330R Resistor and Kathode to Vss (0v).
    		'	
    	BlinkyLED var PortA.0			' This LED will BLINK
    
    	'
    	'	Program Start
    	'	-------------
    	TRISA=%00000000				' Set all I/O to OUTPUT
    	TRISB=%00000000
    	'
    	Pause 2000				' Wait 2 seconds for Hardware to settle
    						' should account for the crappiest and
    						' slowest junk LCD
    Loop:
    	LCDOUT $FE,1				' Clear LCD
    	High BlinkyLED				' Set LED pin High
    	Pause 1000				' Wait one Second
    
    	LCDOUT "Hello Dj tempo"			' Write message
    	Low BlinkyLED				' Set LED pin Low
    	Pause 1000				' Wait one Second
    
    	Goto Loop				' Loop around and do it forever
    
    	End
    Ensure your connect your LCD EXACTLY as per the schematic. If you haven't already done so, go back and check again. Ensure LCD-D4 connects to PortB0 etc. Ensure LCD-D0 thru LCD-D3 are grounded to Vss (0v).

    If your connect an LED as directed in the listing and it doesn't blink, check your oscillator circuit. Easiest for novices is to use a 4MHz 3-pin ceramic Resonator with integral Capacitors.

    If the LED blinks, but still nothing on the LCD, then connect a 10K Pot between Vdd and Vss with the wiper going the the Contrast Vo pin, instead of having that pin connected directly to Ground. Some LCD's don't like having the Contrast pin connected directly to Vss, it applies TOO MUCH contrast and all you get is solid black squares. Yet if that pin is left unconnected, you don't get anything displaying either.

    Good luck with the faultfinding - it's actually the fun part of electronics.

    Melanie
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    if you still want to stick to ASM, try the one in attachment.. yeah same concept here, you'll need to rename it to .asm.

    That was fun to do

    Enjoy
    Attached Files Attached Files
    Steve

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

  8. #8
    Join Date
    Jun 2007
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    why is it that when i copy any of these text files and try to convert it in to a hex file it always shows up with lots of errors, about 60 errors each time.

    therefore i can not copy any of these files and download them on to the micro controller as it is not creating a hex file.
    But the code i have written shows with no errors anymore just warnings.

    am i doing something wrong?
    i normaly create a text file in notepad, then i use MPASM to convert the text file in to a HEX file, i then use PROGPIC 2 along with my velleman hardware programmer board to download on to the PIC, it has worked on other PIC such as 16F627 to create effects such as flashing LED's.

    i downloaded that file of yours mel, when an LED is connected between pin A0 and +5v it constantley flashes almost 1 sec on 1 sec off, all other data lines on the LCD are now grounded and a 10k pot between +5V and 0V with the wiper conn to V0 (contrast), adjustment of the pot varies the contrast but still no luck wit writing on lcd, still shows as 2 rows of blocks on line 1 and 3.
    Last edited by Dj tempo; - 19th June 2007 at 15:50.

Similar Threads

  1. Replies: 2
    Last Post: - 5th November 2009, 18:07
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  4. LCD issue with EasyPIC5
    By manwolf in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 15th June 2008, 10:17
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

Members who have read this thread : 0

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