zhiling0229
Member level 1
Hi guys,
I'm using PIC16F877A with CCS C compiler to develop my program. Initially I used portC and portD but I decided to change to portA and portB but after changing is not working? Can anyone point out the problem in my code:
struct lcd_pin_def
{
BOOLEAN cd; // A0 Command/Data BAR 1=command 0=data
BOOLEAN r_bar; // A1 Read bar active low
BOOLEAN w_bar; // A2 Write bar active low
BOOLEAN reset_bar; // A3 Reset active low
BOOLEAN unused1; // A4
BOOLEAN unused2; // A5
BOOLEAN unused3; // A6
BOOLEAN unused4; // A7
int data : 8; // PortB=Data bus
};
struct lcd_pin_def LCD;
#byte LCD = 0x05 // portA address on 16F877A
#use fast_io(D)
void main() {
setup_adc(ADC_OFF);
set_tris_a(0x00); // graphic lcd control lines all output
}
thanks
I'm using PIC16F877A with CCS C compiler to develop my program. Initially I used portC and portD but I decided to change to portA and portB but after changing is not working? Can anyone point out the problem in my code:
struct lcd_pin_def
{
BOOLEAN cd; // A0 Command/Data BAR 1=command 0=data
BOOLEAN r_bar; // A1 Read bar active low
BOOLEAN w_bar; // A2 Write bar active low
BOOLEAN reset_bar; // A3 Reset active low
BOOLEAN unused1; // A4
BOOLEAN unused2; // A5
BOOLEAN unused3; // A6
BOOLEAN unused4; // A7
int data : 8; // PortB=Data bus
};
struct lcd_pin_def LCD;
#byte LCD = 0x05 // portA address on 16F877A
#use fast_io(D)
void main() {
setup_adc(ADC_OFF);
set_tris_a(0x00); // graphic lcd control lines all output
}
thanks