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 CCS Technical Support

16f88 lcd on port a

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



Joined: 17 Jul 2006
Posts: 7

View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

16f88 lcd on port a
PostPosted: Sun Feb 04, 2007 8:35 pm     Reply with quote

I am trying to setup the lcd using the flex lcd driver. I have gotten it up and working on port b and I was trying to set it up on port a. I keep getting an error when I add the lines to turn off the adc.

I am using a 16F88 with the compiler version 4.021

when I uncomment the acd setup lines I get the error "Command returned error code:1Halting build on first failure as requested." with the lines commented the program compiles correctly but the lcd does not work. I will not even initalize.

Code:

#include <16F88.h>
#fuses INTRC_IO    // internal RC, I/O on pins A6,A7
#fuses NOWDT      // no watch dog timer
#fuses NOPROTECT   // no code protection
#fuses NOLVP      // no low voltage programming
#fuses NOPUT      // no power up timer
#fuses NOMCLR      // I/O on mclr pin
#fuses NOBROWNOUT   // no brown out reset
#fuses NOCPD      // no EE memory protection
#fuses NOWRT      // no flash program write protection
#fuses NODEBUG      // no in-circuit debugger
#fuses NOFCMEN      // no fail-safe clock monitor
#fuses NOIESO      // internal external crossover mode disabled

#use delay(clock=8000000)
// #use rs232(baud=9600, xmit=PIN_B5, rcv=PIN_B2)

// #include <stdlib.h>
#define LCD_DB4   PIN_A4
#define LCD_DB5   PIN_A5
#define LCD_DB6   PIN_A6
#define LCD_DB7   PIN_A7

#define LCD_RS    PIN_A0
#define LCD_RW    PIN_A1
#define LCD_E     PIN_A2

#include <Flex_LCD416.c>   

//===================================
void main(){
//setup_port_a(ALL_DIGITAL);
//setup_adc_ports(NO_ANALOGS);
//setup_adc(ADC_OFF);

int8 i;
int8 b1, b2, b3, b4;

// The lcd_init() function should always be called once,
// near the start of your program.
lcd_init();
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 04, 2007 9:08 pm     Reply with quote

Quote:

I keep getting an error when I add the lines to turn off the adc.
//setup_port_a(ALL_DIGITAL);
//setup_adc_ports(NO_ANALOGS);
//setup_adc(ADC_OFF);

1. setup_port_a() and setup_adc_ports() are the same function.
It says this in the 16F88.H file:
Quote:

SETUP_ADC_PORTS() (aka SETUP_PORT_A)
You don't need to call it twice.

2. There is no "ALL_DIGITAL" constant in the 16F88.H file.
The constants are as follows (from the .H file):
Code:
// Constants used in SETUP_ADC_PORTS() are:
#define sAN0             1         //| A0
#define sAN1             2         //| A1
#define sAN2             4         //| A2
#define sAN3             8         //| A3
#define sAN4            16         //| A4
#define sAN5            32         //| B6
#define sAN6            64         //| B7
#define NO_ANALOGS       0         // None
#define ALL_ANALOG      127        // A0 A1 A2 A3 A4 B6 B7
shroder300



Joined: 17 Jul 2006
Posts: 7

View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

PostPosted: Mon Feb 05, 2007 8:08 pm     Reply with quote

that compiled correctly. thanks!

but the lcd is still not working.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 05, 2007 8:50 pm     Reply with quote

1. Post the manufacturer and part number of your LCD.
Also post a link to the data sheet.

2. Post a link to the driver in the Code Library that you're using.

3. Did you modify the driver in any way ?
(Other than the pin numbers).
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