CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

lcd 2x16 interfacing need pull up?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
omid_juve



Joined: 25 Oct 2012
Posts: 8

View user's profile Send private message

lcd 2x16 interfacing need pull up?
PostPosted: Thu Nov 08, 2012 12:26 pm     Reply with quote

I write a program for my pic, it`s work fine with Proteus but when i test it in real hardware it`s just show a black line on first line of the lcd display.
Does it need a pull up resistor?
WingNut



Joined: 04 Nov 2012
Posts: 6
Location: NC

View user's profile Send private message

PostPosted: Thu Nov 08, 2012 12:38 pm     Reply with quote

What PIC are you using?
What is your compiler version?
No one here is psychic. Post your code.
omid_juve



Joined: 25 Oct 2012
Posts: 8

View user's profile Send private message

PostPosted: Thu Nov 08, 2012 1:13 pm     Reply with quote

plz check my pic is 16f1947 and this the config of lcd pin
Code:

#define LCD_DB4   PIN_D3
#define LCD_DB5   PIN_D2
#define LCD_DB6   PIN_D1
#define LCD_DB7   PIN_D0

#define LCD_E     PIN_E3
#define LCD_RS    PIN_E2

and here is the code
with compiler pcm 4.13
Code:

#include <control valve.h>
#include <stdlib.h>
#include <flex_kbd.c>

#define startpoint 3200
#define error 120
#define cw 1
#define ccw 2
#define ccwm 3
#define threshold 921
#include <lcd_flex.c>

unsigned int16 step1;
unsigned int16 position;
int8 opening;
char m;
float ff1;

 
void main()
{
char c;

set_tris_g(0xf0);
setup_oscillator(OSC_16MHZ|OSC_INTRC|OSC_PLL_OFF,0);
port_b_pullups(0XFF);
setup_adc_ports(sAN2);
setup_adc(ADC_CLOCK_DIV_64);

set_adc_channel( 2 );
delay_us(100);
lcd_init();
kbd_init();

while(m!=ccwm )
  {
   m = kbd_getc();
   lcd_gotoxy(1,1);
   printf(LCD_PUTC, "open=%u",opening);
   lcd_putc("   ");

   if( m==cw)
     {
      if (++opening!=100)
      delay_ms(200);
     }
   else if (m==ccw)
     {
      if (--opening!=0)
      delay_ms(200);
     }

  }

ff1=(opening/100.0);
ff1=ff1*startpoint;
position=ff1;
lcd_putc('\f');
lcd_gotoxy(1,1);
printf(LCD_PUTC, "pos=%Lu",position);
lcd_putc("   ");
delay_ms(1000);

while(true)
  {
   m = kbd_getc();
   if (m==ccw)
     {
      initialize();
      delay_ms(200);
      step_motor_ccw();
     }
   else if (m==ccwm) manual_adjust1();
  }

}
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Thu Nov 08, 2012 2:44 pm     Reply with quote

We also need to know LCD type and compiler version No.

What have you done with LCD W/R pin?

Have you checked that LED flasher code works at EXACTLY the correct speed?

Mike

EDIT Read CCS forum guidelines for instructions on how best to get help.

Get rid of Proteus. Do a search on this forum to assess its worth.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group