| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| shroder300 
 
 
 Joined: 17 Jul 2006
 Posts: 7
 
 
 
			              
 
 | 
			
				| 16f88 lcd on port a |  
				|  Posted: Sun Feb 04, 2007 8:35 pm |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sun Feb 04, 2007 9:08 pm |   |  
				| 
 |  
				|  	  | 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:
 
 You don't need to call it twice. 	  | Quote: |  	  | SETUP_ADC_PORTS() (aka SETUP_PORT_A)
 
 | 
 
 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
 
 
 
			              
 
 | 
			
				|  |  
				|  Posted: Mon Feb 05, 2007 8:08 pm |   |  
				| 
 |  
				| that compiled correctly. thanks! 
 but the lcd is still not working.
 |  | 
	
		|  | 
	
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Mon Feb 05, 2007 8:50 pm |   |  
				| 
 |  
				| 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).
 |  | 
	
		|  | 
	
		|  |