The Godfather talking
This is god damn my place! Capisci?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 12:31:38 12:31


Login with username, password and session length


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

Posts: 14

Thank You
-Given: 20
-Receive: 0


« on: December 31, 2011, 05:29:32 17: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 LCD´s and 2 PIC´s ... 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 ?! i´m 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, 05:42:30 17:42 by Hexer379 » Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4647

Thank You
-Given: 826
-Receive: 4207


There is no evidence that I muted SoNsIvRi


« Reply #1 on: December 31, 2011, 08:09:49 20: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: I stoped Muteing bad members OK I now put thier account in sleep mode
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #2 on: December 31, 2011, 09:47:46 21: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
Active Member
***
Offline Offline

Posts: 218

Thank You
-Given: 26
-Receive: 63


« Reply #3 on: December 31, 2011, 10:42:55 22: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: 20
-Receive: 0


« Reply #4 on: January 01, 2012, 01:55:19 01: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: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #5 on: January 01, 2012, 01:06:07 13: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: 20
-Receive: 0


« Reply #6 on: January 01, 2012, 01:44:30 13: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
**
Offline Offline

Posts: 89

Thank You
-Given: 101
-Receive: 26


« Reply #7 on: January 01, 2012, 02:06:05 14: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: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #8 on: January 01, 2012, 02:27:12 14: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: 20
-Receive: 0


« Reply #9 on: January 01, 2012, 03:47:15 15: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: 4647

Thank You
-Given: 826
-Receive: 4207


There is no evidence that I muted SoNsIvRi


« Reply #10 on: January 01, 2012, 04:02:18 16: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: I stoped Muteing bad members OK I now put thier account in sleep mode
Hexer379
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 20
-Receive: 0


« Reply #11 on: January 01, 2012, 04:05:37 16: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: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #12 on: January 01, 2012, 04:49:06 16: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: 20
-Receive: 0


« Reply #13 on: January 01, 2012, 08:01:57 20: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: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #14 on: January 01, 2012, 09:31:16 21: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, 09:33:36 21:33 by bbarney » Logged

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

Posts: 14

Thank You
-Given: 20
-Receive: 0


« Reply #15 on: January 02, 2012, 11:48:42 11: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: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #16 on: January 02, 2012, 04:05:07 16: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