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
Dr. Carlos Hernandez.
/*
This program configures the TIMER0 of the PIC182550 for a periodic interrupt.
/*
void interrupt() {
PORTC.F0 = ~PORTC.F0;
INTCON.TMR0IF=0; // clear the TIMER0 interrupt
TMR0L = 100;
T0CON.TMR0ON = 1;
}
void main() {
PORTC = 0;
LATC = 0;
TRISC = 0x00;
INTCON.GIE = 1; // Global interrups enable
INTCON.PEIE = 1; // peripheri.
INTCON.INT0IE = 0; // external interrup enable
INTCON.TMR0IE = 1; // TIMER0 interrupt enable
INTCON2.TMR0IP = 1; //TMR0 Overflow Interrupt Priority bit
T0CON.T08BIT = 1; //8 bits TIMER0 configuration
T0CON.T0CS = 0; //Timer0 Clock Source Select bit,
//0 = Internal instruction cycle clock (CLKO)
T0CON.PSA = 0; //0 = Timer0 prescaler is assigned.
// Timer0 clock input comes from prescaler output.
T0CON.T0PS0 = 1; // Timer0 Prescaler Select bits
T0CON.T0PS1 = 1;
T0CON.T0PS2 = 1;
TMR0L = 100;
T0CON.TMR0ON = 1; //start TMR0
while(1){
}
}
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