Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

HD44780 and PIC 16F819

Status
Not open for further replies.

brentonw2004

New Member
Hello everyone. My first question is about my LCD. I have a Truly Brand, 16x1, 44780 compatible LCD screen that I am trying to get working with a PIC 16F628. I can get the LCD to come on whenever I plug the first three pins in and set the contrast, but only the first 8 digits/characters appear to be coming on. I cannot get it to respond to the microchip at all. I am trying to use 8-bit mode just to get the hang of things, and I am trying to program it with Pic Basic Pro with the LCDOUT command. I have the input pins of the LCD, DB0-DB7, hooked up on PORTB of my PIC. I have R/S hooked into PORTA.0, and E is hooked into PORTA.1. Here is the code that I am trying to use:

'************BEGIN SOURCE******************

INCLUDE "modedefs.bas"

DEFINE OSC 4

' Set LCD Data port
DEFINE LCD_DREG PORTB
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 0
' Set LCD Register Select port
DEFINE LCD_RSREG PORTA
' Set LCD Register Select bit
DEFINE LCD_RSBIT 0
' Set LCD Enable port
DEFINE LCD_EREG PORTA
' Set LCD Enable bit
DEFINE LCD_EBIT 1
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 8
' Set number of lines on LCD
DEFINE LCD_LINES 2
' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 50

Lcdout $FE, 1
PAUSE 500
loop:
LCDOUT $FE, 1, "Hello" ' Clear display and show “Hello
goto loop

'************END SOURCE******************

Everything compiles, and loads fine, but it doesn't do anything on the LCD. The only way I even know the LCD is on is to darken the contrast really dark and then you can see the first 8 boxes. Any advice?

Here is my second question. I have a PIC 16F819 that I am trying to program using Pic Basic Pro and MicroCode Studio Plus. I cannot find the 16F819 in the "target processor" menu of MicroCode Studio, but I have the .inc and .bas file for this chip in my Pic Basic Pro directory. Any advice would be greatly appreciated.

Thanks!
Brenton
 
How do you have your LCD connected to the PIC... is it just lie you are defining it?

Also make sure to send a command to turn on the LCD.... most of the LCD come with the screen off, even thought you have them powered on. So the LCD receives all the commands and characters but you will no be able to see them because the screen is off.

About MiroCode Studio, according to their site they only support the following PICs

Available ICD Models


MicroCode Studio uses an ICD Model in order to initialise and control the operation of the ICD for a given PIC microcontroller.

MicroCode Studio Plus

The ICD for MicroCode Studio Plus currently supports the following PIC microcontroller devices.

16F627(A), 16F628(A), 16F73, 16F74, 16F76, 16F77, 16F870, 16F871, 16F873(A), 16F874(A), 16F876(A), 16F877(A), 18F242, 18F248, 18F252, 18F258, 18F442, 18F448, 18F452, 18F458, 18F1220, 18F1320, 18F2220, 18F2320, 18F4220, 18F4320, 18F6620 and 18F8620

MicroCode Studio

The ICD for MicroCode Studio supports the following PIC microcontroller device.

16F628

Good Luck

Ivancho
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top