Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2016, 10:48:43 22:48


Login with username, password and session length


Pages: [1]
Print
Author Topic: HD77-LCD & 16F876 Problem  (Read 3173 times)
0 Members and 1 Guest are viewing this topic.
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« on: December 31, 2011, 06:29:32 18:29 »

Hello ... @all ...

i have a Problem with a simple Testprogram ... (see code fragment)

the Output is switching (toggle) ...
so the Programm & Pic is working ...
i have try 3 LCDs and 2 PICs ... all the same ... the LCD shows nothing ...
in simulation (ISIS) it works ...
my compiler is :Proton PicBasic v3.5.2.7 ...
the LCD should be work in 4-Bit-Mode !

knows everyone where the problem is ?! im very confused ... !!!

Best Regards , Thomas ...





Code:
Device = 16F876

Declare Xtal = 10
Declare Watchdog = Off

Declare Slow_Bus   On
Declare Hbus_Bitrate 100
Declare Hserial_Baud = 9600



Declare Adin_Res        10
Declare Adin_Tad        32_FOSC
Declare Adin_Stime      40

        Declare LCD_DTPin       PORTB.4
        Declare LCD_ENPin       PORTB.2
        Declare LCD_RSPin       PORTB.3
        Declare LCD_Interface   4

TRISA                   = %11111111
        ADCON0                  = %11000001
ADCON1                  = %11000000
        ADCON1.0                = 0               ' Bit0 is Ref. Ext(1)Or 5V(0)


        Dim ChecksumOp          As Word
            ChecksumOp          = 139


        Symbol AD_5V_In         = ADIn 0
        Symbol AD_33V_In        = ADIn 3
        Symbol AD_17V_In        = ADIn 1
        Symbol AD_Batt_In       = ADIn 0

        Output  PORTC.1
        Low     PORTC.1
        Symbol  GoldCap         = PORTC.1
        Output  PORTC.2
        Low     PORTC.2
        Symbol  LadenBatt       = PORTC.2
        Output  PORTC.3
        Low     PORTC.3
        Symbol  BattStrom       = PORTC.3
        Output  PORTC.4
        Low     PORTC.4
        Symbol  MainReset       = PORTC.4
        Output  PORTC.5
        Low     PORTC.5
        Symbol  SendActive      = PORTC.5




Cls
DelayMS 500

loop:
Cls
DelayMS 150

Print At 1,1,Dec AD_5V_In," ",Dec AD_33V_In
Print At 2,1,Dec AD_17V_In," ",Dec AD_Batt_In

DelayMS 500
Toggle LadenBatt
GoTo loop
« Last Edit: December 31, 2011, 06:42:30 18:42 by Hexer379 » Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 3816

Thank You
-Given: 567
-Receive: 2049


There is no evidence that I muted SoNsIvRi


« Reply #1 on: December 31, 2011, 09:09:49 21:09 »

yes what are your fuse settings

Most pic chip code fails to run if fuses are not set up right.
you could try ALL_DIGITAL = TRUE

or set the configure fuses using the appropriate registers
Logged

Note: If you have no posts other than, I want or reporting a dead link Then you can't complain If I remove your post So Stop Leeching
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2403

Thank You
-Given: 405
-Receive: 544


Uhm? where did pickit put my mute button


« Reply #2 on: December 31, 2011, 10:47:46 22:47 »

get your lcd working first by using a simple program, then add in your other stuff to the program

this should work without adding fuse setting but they are there if needed (remember LVP pin is RB3 )
and check your contrast on the lcd

Quote

     Device = 16F876
           ;-------------------------------------------------------------------------------
   Declare Reminders Off
   @ CONFIG_REQ = 0 ; Override Compiler's configuration settings
   Asm-
   __Config  0x3D3A ;FOSC_HS & WDTE_OFF & PWRTE_OFF & CP_OFF & BOREN_OFF & LVP_OFF & CPD_OFF & WRT_OFF & DEBUG_OFF
   Endasm-
   Declare Reminders On
          ;-------------------------------------------------------------------------------   
    Xtal = 10
    All_Digital = True
    'PortB_Pullups = True
 
    LCD_DTPin = PORTB.4
    LCD_RSPin = PORTB.2
    LCD_ENPin = PORTB.3
    LCD_Interface = 4
    LCD_Lines = 2
    LCD_Type = 0
   'LCD_CommandUs = 2000
   'LCD_DataUs = 50       
   'Initialize LCD
    DelayMS 150
    Cls
   
    Loop:
   
    Print At 1,1,"test line 1 "
    Print At 2,1,"test Line 2 "
   
    DelayMS 500
   
    GoTo Loop
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
TomJackson69
V.I.P
Active Member
*****
Offline Offline

Posts: 221

Thank You
-Given: 23
-Receive: 63


« Reply #3 on: December 31, 2011, 11:42:55 23:42 »

@Hexer379

Maybe this will help:

This is an example from picBasic which is very close to what you are doing.

Using the PIC16F877 A/D Converter. This example displays 3-channels of analog input on an LCD display.

link to the project:
http://www.rentron.com/PICX1.htm

http://www.rentron.com/PICX2.htm
Logged

Con Rong Chau Tien
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« Reply #4 on: January 01, 2012, 02:55:19 02:55 »

Hello ... @all ...

thanks for the fast answer !

@bbarney ... i have try this progam ... same result ... :-(
i have a poti for contrast ... this is not the problem ...

i have attach the fuse-settings ... this should work i think ...

any other ideas ?!

Best Regards , and a happy new year ... Thomas ...
Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2403

Thank You
-Given: 405
-Receive: 544


Uhm? where did pickit put my mute button


« Reply #5 on: January 01, 2012, 02:06:07 14:06 »

Post a schematic and maybe a link to the lcd datasheet might help
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« Reply #6 on: January 01, 2012, 02:44:30 14:44 »

Hello ... @all ... HAPPY NEW YEAR !!!  Cool


here the schematic for the Test in ISIS ... the hardware is the same ...  Grin



Best Regards , Thomas ...
Logged
gan_canny
Junior Member
**
 Warned
Offline Offline

Posts: 85

Thank You
-Given: 98
-Receive: 25


« Reply #7 on: January 01, 2012, 03:06:05 15:06 »

Well, if it doesn't work in the simulator it is rare it will work with the real system. Your circuit works in the simulator but it is not at all guaranteed it will work in the real world but you know that already. Now if the LCD is blank (black all gray or the character positions are just visible above the background gray) the bias supply is often the issue. I see no connection to VDD ( a positive  voltage) for the LCD and the bias if I remember is on VEE. The bias is often a negative voltage or possibly ground voltage. If the voltages are correct the character positions can be seen (often all pixels on) and with reasonable contrast to the background (assuming a good bias voltage). Next the LCD needs to initiate correctly but chances are the code you are using is doing this correctly and with the right timing so look first at the VDD and VEE voltages.
Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2403

Thank You
-Given: 405
-Receive: 544


Uhm? where did pickit put my mute button


« Reply #8 on: January 01, 2012, 03:27:12 15:27 »

I meant a real schematic showing your real hardware connections isis doesn't show your powers or ground for the chip ,there are 2 of each on that chip you do have them connected ?
it also doesn't show wether you have any caps on the crystal mirochip recommends 15pf to 33 pf (closer to 33 is best for 10mhz )
we need a little more than just an isis schematic to help
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« Reply #9 on: January 01, 2012, 04:47:15 16:47 »

Hello ... @all ...

@gan_canny

when i connect the power , i see all dots ON (black) when i use full contrast ...
In real , the PIC with LCD is on a breadboard with is connected to 0V (GND) and +5V ... All power-pins to the PIC are connected !
MCLR is @real connected to +5V over a 3k resistor !
In ISIS VDD to LCD is not connected because i have forgot this ... (but not need in ISIS)


@bbarney
In real , the PIC with LCD is on a breadboard with is connected to 0V (GND) and +5V ... All power-pins to the PIC are connected !
MCLR is @real connected to +5V over a 3k resistor !
i use a 10MHz Oscillator with TTL-Output with is connected to CLKIn @PIC ! so i think it is not necessary to use any Cs ...

the wires from PIC to LCD is about 10cm long ...
i have test all Pins to LCD with a Oszi ... all Pins have activities ... ?!?!?!?!

this is a very strange Problem ...

Thank you ... Thomas ...
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 3816

Thank You
-Given: 567
-Receive: 2049


There is no evidence that I muted SoNsIvRi


« Reply #10 on: January 01, 2012, 05:02:18 17:02 »

If your working with a breadboard all your timings maybe upset.
Also try moving RS & E to port A or C to see if this helps.
you will need to change your code.
Logged

Note: If you have no posts other than, I want or reporting a dead link Then you can't complain If I remove your post So Stop Leeching
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« Reply #11 on: January 01, 2012, 05:05:37 17:05 »

Hello ...

i have change the 2 Pins to Port C ... now , i have a blinking cursor @pos.1 the rest of the LCD is empty ...

best Regards , Thomas ...
Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2403

Thank You
-Given: 405
-Receive: 544


Uhm? where did pickit put my mute button


« Reply #12 on: January 01, 2012, 05:49:06 17:49 »

Quote
i use a 10MHz Oscillator with TTL-Output with is connected to CLKIn @PIC ! so i think it is not necessary to use any Cs ...

you need the CAPS , probably the only reason it is remotely working at all now is all the stray capacitance from the breadboard taking their place

Give us a link to your lcd datasheet
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« Reply #13 on: January 01, 2012, 09:01:57 21:01 »

Hello ...

caps are installed now ... no change ...
The Display is "ALPS hcn-111" the other one is a batron "LCM038-02"

the alps was a testdisplay ... it was functional on many tests with pics ... and it is 100% HD44780-compatible ! lt.google ! (the topic-title is wrong :-( HD77 ?!)


Best Regards , Thomas ...
Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2403

Thank You
-Given: 405
-Receive: 544


Uhm? where did pickit put my mute button


« Reply #14 on: January 01, 2012, 10:31:16 22:31 »

I just tried 3 different  HD44780-compatible  16x2  displays and my code a few post's above  and they all worked fine , so you must have bad hardware or a wiring problem somewhere because it's working fine here

make a schematic of how you have it wired up on the breadboard or even a picture
« Last Edit: January 01, 2012, 10:33:36 22:33 by bbarney » Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 17
-Receive: 0


« Reply #15 on: January 02, 2012, 12:48:42 12:48 »

Hello ...



thank you ... for all the answers ! ...
i have now make a test-circuit board and it works now ... the same config on the breadboard is not working ...
VERY STRANGE ! ...

sorry , for all this ...

Best Regards , Thomas ...
Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2403

Thank You
-Given: 405
-Receive: 544


Uhm? where did pickit put my mute button


« Reply #16 on: January 02, 2012, 05:05:07 17:05 »

probably a bad breadboard , most of them are not that well made
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC