/*
LCD MikroC PIC18F2550
*/
unsigned int i = 0;
unsigned int temp_res=0;
unsigned int temp_average=0;
float temperature = 0;
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC6_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC6_bit;
// End LCD module connections
char txt1[] = "STARTING";
char txt2[10];
char txt3[15];
void main() {
PORTC = 0;
LATC = 0;
TRISC = 0x00;
PORTA = 0;
CMCON = 0;
TRISA = 0xFF;
ADCON1 = 0x0E; // entradas digitales // 0xE
PORTB = 0;
TRISB = 0xCF;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,txt1); // Write text in first row
Delay_ms(300);
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Out(1,1,"DR:"); // Write text in first row
Lcd_Out(2,1,"CARLOS HERNANDEZ"); // Write text in first row
Delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR);
while(1) {
//adc_temperature();
i++;
IntToStr(i, txt2);
Lcd_Out(2,0,txt2);
delay_ms(500);
if(i==100){
i=0;
}
}
}
In this blog you will find information about my electronic courses such as FPGAs, ARM microcontrollers and PIC microcontrollers. In addition, I will be uploading selected topics from my semiconductor research.
lunes, 12 de marzo de 2018
Suscribirse a:
Comentarios de la entrada (Atom)
BTFSS INSTRUCTION IN ASSEMBLER FOR PIC18F In this sample, we show that how to use a switch input to make an action. Remember that I...
-
Ultrasonic sensor HC-RS04 for robotics applications using VHDL In this sample, I show how to design the architecture of the ultr...
-
SPI DAC MCP4921 USING VHDL In this Post, I want to share the procedure to design an SPI driver for MCP4921 using VHDL. If you are ...
-
Bluetooth HC05 using VHDL In this post, I show the architecture of the RS-232 driver for the Bluetooth module HC05 which is set to wo...
No hay comentarios.:
Publicar un comentario