Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 24th August 2004, 04:57 PM   (permalink)
Default Hey Nigel, help with your PIC LCD tutorial

I copied the entire code on your LCD tutorial just to see if I could get my LCD working.
I am using a 16F84A, so I changed the processor name at the top, as well as the include file.
I also omitted the two lines that turn the 16F628 comparators off.
When I turn it on, the cursor flashes, jumps forward two characters, then jumps 3 characters forward and thats it! No characters, just a cursor.

Have you got any suggestions about what I might try?

Also, do you have a schematic for the LCD-PIC pin assignments? I couldnt find it on your site.

By the way, thank you much for the tutorials and the software. It is very helpful for beginners like me.
NewGeek is offline  
Old 24th August 2004, 05:17 PM   (permalink)
Default Re: Hey Nigel, help with your PIC LCD tutorial

Quote:
Originally Posted by NewGeek
I copied the entire code on your LCD tutorial just to see if I could get my LCD working.
I am using a 16F84A, so I changed the processor name at the top, as well as the include file.
I also omitted the two lines that turn the 16F628 comparators off.
When I turn it on, the cursor flashes, jumps forward two characters, then jumps 3 characters forward and thats it! No characters, just a cursor.

Have you got any suggestions about what I might try?
It should work OK on a 16F84, as long as you use PortB - although I would check the start address for the general purpose registers, I'm not sure the start address is the same (it's been a long time since I used one).

Quote:
Also, do you have a schematic for the LCD-PIC pin assignments? I couldnt find it on your site.
There are basically two different connections for LCD's, either single inline or dual inline, both should have numbers printed on the boards (or at least pin 1), the numbers correspond to those on the LCD hardware page.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 24th August 2004, 05:34 PM   (permalink)
Default

Yes, that was the one other thing I changed:

Your code:

LCD_PORT Equ PORTA
LCD_TRIS Equ TRISA

I changed to:

LCD_PORT Equ PORTB
LCD_TRIS Equ TRISB

Is that all I need to do?

Sorry, I somehow missed the hardware page link. I will check the addressed. Thanks for your help
NewGeek is offline  
Old 24th August 2004, 06:09 PM   (permalink)
Default

Yes, that was the one other thing I changed:

Your code:

LCD_PORT Equ PORTA
LCD_TRIS Equ TRISA

I changed to:

LCD_PORT Equ PORTB
LCD_TRIS Equ TRISB

Is that all I need to do?

Sorry, I somehow missed the hardware page link. I will check the addressed. Thanks for your help
NewGeek is offline  
Old 24th August 2004, 06:16 PM   (permalink)
Default

This is an example that a student, i'm advising, did.

A 16 x2 LCD.
Attached Files
File Type: zip lcd1.zip (2.3 KB, 136 views)
falleafd is offline  
Old 24th August 2004, 08:20 PM   (permalink)
Default

Quote:
Originally Posted by falleafd
This is an example that a student, i'm advising, did.

A 16 x2 LCD.
It's really nice to see my code being used, a lot of blood, sweat and tears went in to getting the LCD routines how they are
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 24th August 2004, 09:40 PM   (permalink)
Default

A question about the start address: does the start address in the code have to be the FIRST address in the GPR or can it be any address in the GPR?
i.e. can you store values anywhere in the GPR or do they have to be sequential, starting at the first available?

for the PIC16F84 the GPR starts at 0x0C but could I code my first variable like this:

MyVar equ 0x0E

does it matter where I start? I know logically it makes sense to start the first address, but just curious
NewGeek is offline  
Old 25th August 2004, 03:20 AM   (permalink)
Default

Yes, it is modified from your code nigel. But I would like to give it here because my student know a little bit about PIC before he made this. So it may help beginners of 84A. he simplize your code nigel, so it may cause problems, i'm sure.
falleafd is offline  
Old 25th August 2004, 06:48 AM   (permalink)
Default

Actually I ended up using Nigel's code. Its working now and Im playing around with it making changes.
The code from Falleafd worked (text was displayed), but there were a bunch of interrupt routines that were causing some weird and unpredictable multi-layered loops. Without the schematic for his interrupt switches, it made Nigels code look much easier.

So FYI Nigel, your code works fine on a PIC16f84A, the only changes are:

Change the LCD_PORT to PORTB
Change LCD_TRIS to TRISB
Remove command to turn off comparators
Wire it up using your schematic, but substitute RB0 through RB7 for RA0 through RA7.
Pretty simple actually, I had a misplaced wire on my breadboard.

You probably already know this but I wanted to post for other newbies. Thanks again Nigel and Falleafd!
NewGeek is offline  
Old 25th August 2004, 06:51 AM   (permalink)
Default

Quote:
Originally Posted by NewGeek
A question about the start address: does the start address in the code have to be the FIRST address in the GPR or can it be any address in the GPR?
i.e. can you store values anywhere in the GPR or do they have to be sequential, starting at the first available?

for the PIC16F84 the GPR starts at 0x0C but could I code my first variable like this:

MyVar equ 0x0E

does it matter where I start? I know logically it makes sense to start the first address, but just curious
You can start where you like, but (as you say) it makes sense to start at the first address - basically because it's giving you the largest number of registers then.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 26th August 2004, 05:23 PM   (permalink)
Default

Quote:
Originally Posted by NewGeek
Actually I ended up using Nigel's code. Its working now and Im playing around with it making changes.
The code from Falleafd worked (text was displayed), but there were a bunch of interrupt routines that were causing some weird and unpredictable multi-layered loops. Without the schematic for his interrupt switches, it made Nigels code look much easier.
Yes, ofcourse, because he's newbie like you, so he's just copy and paste nigel's code, then he modified some places, but he didn't know why. So some weird still stay still )

Anyways, it's good that you did your LCD.

Thanks for noting it for meeh.
falleafd is offline  
Old 29th August 2004, 04:02 PM   (permalink)
Default

Oh sorry Nigel,

my student did come to this site and see his code, because I tell him that something went wrong with his code. He said that I posted the wrong code :-). I'd showed him the errors when writing interrupt on change, however, he didn't resend me his new code yet...

sorry for my carelessness.
falleafd is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 03:57 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker