Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
/* Project: Unit 05 - INT
Code: unit_05_05_INT0_INT1_INT2.c
Objective: In this project let's use INT0, INT1& INT2 INTERRUPTIONS, all together:
By pressing PORTB.RB0(INT0) an LED(PORTD.RD4) will light up \o/
By pressing PORTB.RB1(INT1) an LED(PORTD.RD5) will light up \o/
By pressing PORTB.RB2(INT2) an LED(PORTD.RD6) will light up \o/
All external interrupts (INT0, INT1 and INT2)
can wakeup the processor from Idle or Sleep modes "/
/* Project: Unit 05 - INT
Code: unit_05_04_INT0.c
Objective: In this project let's use INT0 INTERRUPTION: By pressing
PORTB.RB0(INT0) an LED(PORTD.RD4) will light up \o/
All external interrupts (INT0, INT1 and INT2)
can wakeup the processor from Idle or Sleep modes "/
Author: microgenios, edited by J3
/* Project: Unit 05 - INT
Code: unit_05_03_adcInterruption.c
Objective: In this project let's use INTERRUPTION:
Read 20 sample form ADC and present the arithmetic result in the LCD.
At the end of the conversion, then the Interrupt Indicator Flag will be set (ADIF).
            Consequently, as soon as it is set, the program will be diverted
            for an interrupt routine. (formerly void interrupt_low ())
            In this routine we should do the ADC readings and
            store the values in a buffer in an amount
/* Project: Unit 05 - INT
Code: unit_05_02_highLowPrioritiesInterruptions.c
Objective: 2 interruptions & 1 pulling (High and low priorities setups):
By enable High Prior Interruption (TMR4), an LED (connected to PORTD.RD4)
will toggle every 200 ms, while, to comparative purpose,
by using polling technique, another LED (connected to PORTD.RD4)
will toggle every 1s, and again,
by enable Low Prior Interruption (TMR5), an LED (connected to PORTD.RD5)
will toggle every 1000 ms (1000ms/200ms => scaled 5:1)
/* Project: Unit 05 - INT
Code: unit_05_01_blinkInterruption.c
Objective: This is Interruption Hello World (blinking LEDs)!
By enable interruption, an LED (connected to PORTD.RD0)
will toggle every 200 ms, while, to comparative purpose,
by using polling technique, another LED (connected to PORTD.RD1)
will toggle every 1s (1000ms/200ms => scaled 5:1).
See Calculation memory below:)
/*
* Project name:
unid_04_09_timer0_50ms.c ([email protected])
* Copyright:
(c) J3, Oct 2019
* Revision History:
V 1.0
Initial compilation
* Status:
100% completed
#define TRUE 1
/*
* Project name: Unit 04 - TMR
unit_04_08_timer0_500ms.c [[email protected]]
* Copyright:
(c) J3, Oct 2019
* Revision History:
Version 1.0 - Oct, 2019
Initial compilation
/* Project: Unit 04 - TMR
Code: unit_04_07_timer2.c [[email protected]]
Objective: In this project we will program TIMER2;
Each TMR2's pulse will toggle LED at PORTD.RD0.
Two buttons are used to STOP / GO the Timer2
See Math Formula Memory presented below:)
Author: microgenios, edited by J3
/* Project: Unit 04 - TMR
Code: unit_04_06_timer1asCounterLCD.c [CNT@65536PULSES]
Objective: In this project we will program TIMER1
AS COUNTER and present results on LCD.
Here you will learn about UNION \o/
(see please preview example using LED)
Author: microgenios, edited by J3
/* Project: Unit 04 - TMR
Code: unit_04_05_timer1asCounter.c [CNT@1PULSE]
Objective: In this project we will program TIMER1 AS COUNTER.
Each pulse on PORTC.RC0 will toggle LED at PORTD.RD0:)
See Calculation Memory presented below:)
Author: microgenios, edited by J3
PIC Lessons: How to Start to Program PIC 18 - Step-by-step for Beginners!