Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Tools
Old 4th May 2008, 12:17 AM   #1
Default My First post here....looking for a little help(PIC)

I'm designing a project to interface with my car to extract certain information to analyze. I've created a PCB for the project, and have the majority of the code written, however, i'm having issues. On my development board, i have no trouble initializing the LCD screen that i've purchased.... using PIC16f877A.... my circuit uses PIC16F688.. On my circuit, the LCD will not initialize, using the same code from the 877. I was wondering if it's a software issue, or a hardware issue, and if i'm going about the whole thing wrongly.



that is the top down view of the LCD portion of my board (the power is on another layer).... ive assigned the following pins:
LCD <> PIC
D7 C5
D6 C4
D5 C3
D4 C2
D3 gnd
D2 gnd
D1 gnd
D0 gnd
E C1
Rw gnd
Rs C0

and set the following tags:
ADCON1 := 0; // no analog >< digital conversions
ANSEL := 0; // no analog inputs
ADCON0 := 0; // no analog >< digital conversions
CMCON0 := 7; // no comparators
TRISA := 2; // all but pin 2 is output
TRISC := 0; // all outputs on port C


help?
Lithium381 is offline  
Old 4th May 2008, 12:57 AM   #2
Default

Is that Pascal? Also I read somewhere leave the 4 unused data pins on the LCD floating. Your layout seems to be missing many traces.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is offline  
Old 4th May 2008, 02:58 AM   #3
Default

It looks like Pascal ... Not many pascal pic compilers around so I assume you use mikroPascal for PIC. If you are, pay attention that you change in your project settings the MCU type (it is 16F877A by default) to 16F688 and recompile the code.

Also, if you are using built in functions to access lcd do not forget to config the LCD library as by default D port is used, for you setup it should be something like:
Lcd_Config(&PORTC, 0, 1, 7, 5, 4, 3, 2);

If you do not execute Lcd_Config() the default port used is PORTD as that is where LCD is connected on easypic
arhi is offline  
Old 4th May 2008, 03:26 AM   #4
Default

Ahh A person also using ME's Pascal
arhi: Hit it on the nose most likely, damn that edit project screen!

I bet it was an easypic5 like mine, which would make it Lcd_Config(PORTB, 3, 2, 1, 0, PORTB, 4, 6, 5);

I have to agree, your missing some traces there. It's hard to say cause we know nothing about the other parts. Even using 4 bit mode, you would still have like 7 or so.
-BaC


Quote:
Originally Posted by Lithium381
I'm designing a project to interface with my car to extract certain information to analyze. I've created a PCB for the project, and have the majority of the code written, however, i'm having issues. On my development board, i have no trouble initializing the LCD screen that i've purchased.... using PIC16f877A.... my circuit uses PIC16F688.. On my circuit, the LCD will not initialize, using the same code from the 877. I was wondering if it's a software issue, or a hardware issue, and if i'm going about the whole thing wrongly.



that is the top down view of the LCD portion of my board (the power is on another layer).... ive assigned the following pins:
LCD <> PIC
D7 C5
D6 C4
D5 C3
D4 C2
D3 gnd
D2 gnd
D1 gnd
D0 gnd
E C1
Rw gnd
Rs C0

and set the following tags:
ADCON1 := 0; // no analog >< digital conversions
ANSEL := 0; // no analog inputs
ADCON0 := 0; // no analog >< digital conversions
CMCON0 := 7; // no comparators
TRISA := 2; // all but pin 2 is output
TRISC := 0; // all outputs on port C


help?
__________________
Error[888] "while trying to load":[reality.sh] kernel: [Panic!]...{Universe has been Modified!}...

Last edited by BaCaRdi; 4th May 2008 at 04:10 AM.
BaCaRdi is offline  
Old 4th May 2008, 04:31 AM   #5
Default

@bacardi I actually use MikroC and not Pascal (and easypic4 as 5 is pretty new, what can I say, the mikroelektronika workshop is 10min drive from my house) but I presume they are pretty same on the "edit project" note ..

anyhow if he connected the pins as he wrote ..
Quote:
LCD <> PIC
D7 C5
D6 C4
D5 C3
D4 C2
D3 gnd
D2 gnd
D1 gnd
D0 gnd
E C1
Rw gnd
Rs C0
then he should
Lcd_Config(PORTC, 0, 1, 7, 5, 4, 3, 2);

also, he should check the syntax as in mikroC there is
Code:
void Lcd_Custom_Config(char * data_port, char db3, char db2, char db1, char db0, char * ctrl_port, char rs, char ctrl_rw, char enable);
and
Code:
void Lcd_Config(unsigned short *port, unsigned short RS, unsigned short EN, unsigned short WR, unsigned short D7, unsigned short D6, unsigned short D5, unsigned short D4);
both used for 4bit LCD interface ...

there is lcd8... for 8bit interface but I do not see any reasons for using it
arhi is offline  
Old 4th May 2008, 08:09 AM   #6
Default

Quote:
Begin
delay_ms(500);

ADCON1 := 0; // no analog >< digital conversions
ANSEL := 0; // no analog inputs
ADCON0 := 0; // no analog >< digital conversions
CMCON0 := 7; // no comparators
TRISA := 2; // all but pin 2 is output
TRISC := 0; // all outputs on port C

PORTA.2 := 1;
delay_ms(250); (* Flash LED to indicate *)
PORTA.2 := 0; (* functioning of PIC *)
delay_ms(250);

Lcd_Config(PORTC, 5, 4, 3, 2, PORTC, 0, 1, 1); (* Initalize LCD on portC*)
that's the only code i use regarding the LCD other than simple write commands. True, i do use the EasyPic5 and the Pascal complier for it... on the board, it's portB by default, and i can get that working with my PIC16f877.... on my 16f688, i don't have portB, so i used portC instead. In terms of missing traces, which ones? I would love for it to be that simple!!

the only traces not shown on my circuit board are the power/contrast, which i haven't included pin the picture, i know those work, the LCD turns on, but i can't get commands to it. I've got 4 data lines, the E, and the Rs going to the PIC, for a total of 6, i don't use the Rw, since i'll never read from it, i've just grounded that one, as well as the unused data pins.

and i have done EDIT project and changed those settings... i use an external clock @ 20mhz
Lithium381 is offline  
Old 4th May 2008, 04:08 PM   #7
Default

You're missing all your power and gnd pins, no 0.1uf decoupling caps (you'll see the all over your EasyPIC PCB) The contrast pot isn't there. GND the RW line on the LCD... How are you powering it?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is offline  
Old 4th May 2008, 10:45 PM   #8
Default

Quote:
Originally Posted by blueroomelectronics
You're missing all your power and gnd pins, no 0.1uf decoupling caps (you'll see the all over your EasyPIC PCB) The contrast pot isn't there. GND the RW line on the LCD... How are you powering it?

Really?.... No... Really?


Lithium381:
Quote:
the only traces not shown on my circuit board are the power/contrast, which i haven't included pin the picture, i know those work, the LCD turns on, but i can't get commands to it. I've got 4 data lines, the E, and the Rs going to the PIC, for a total of 6, i don't use the Rw, since i'll never read from it, i've just grounded that one, as well as the unused data pins.
Quote:
that is the top down view of the LCD portion of my board (the power is on another layer).... ive assigned the following pins:
LCD <> PIC
D7 C5
D6 C4
D5 C3
D4 C2
D3 gnd
D2 gnd
D1 gnd
D0 gnd
E C1
Rw gnd
Rs C0
I'm new here, and i don't want to sound mean, but did you even read the post? I've only shown traces/pins relevant directly to the LCD. The power is on another layer on the PCB, as i stated before.... it's properly powered and grounded.... the LCD turns on, but i cannot issue commands to it. You're right, there is no contrast pot, i grounded that one too. i get the blocks on the top row, and blank on the bottom. I'm having trouble communicating with it via the PIC. My issue is that it works with the 16f877 on the easypic, but not with my 16f688 on my pcb.
Lithium381 is offline  
Old 4th May 2008, 10:58 PM   #9
Default

Quote:
Originally Posted by Lithium381
and i have done EDIT project and changed those settings... i use an external clock @ 20mhz
Did you also change the configuration fuses? HS_OSC?
__________________
Steve
mister_e is offline  
Old 5th May 2008, 12:02 AM   #10
Default

Quote:
Originally Posted by Lithium381
You're right, there is no contrast pot, i grounded that one too.
That will not work .. If you ground the contrast line the LCD will be either too light (you will not see anything on it even if it is actually showing the txt) or you will only see black boxes instead of the txt. So you *have to* use the contrast pot to get the display to show the txt. Try it on the easypic, if you turn the embedded contrast pot to max or min you'll see that there is nothing on the lcd.
arhi is offline  
Reply

Tags
helppic, herelooking, post

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Where should I post to get cct design help ? scottb721 General Electronics Chat 3 13th March 2007 06:15 PM
Why cant I post? Rolf Feedback/Comments 15 27th October 2006 05:41 PM
LEDs 2nd Post. RayH General Electronics Chat 2 19th April 2005 02:47 AM
All newbies should read before post TheOne General Electronics Chat 1 19th January 2005 07:03 PM
First Post, Basic Questions ... budidharma General Electronics Chat 11 21st November 2004 04:41 AM



All times are GMT. The time now is 12:14 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker