How to work with inbuilt Analog Comparators of PIC18F4550

Analog comparator is an electronic device which compares the two voltage signals and provides TTL logic output to indicate the larger signal. The analog comparator is used in various applications where two inputs signals need to be compared. IR sensor is a very common example where analog comparator is used. PIC18F4550 has two in-built comparators which can be used in eight different modes. These in-built c ...

Read more

How to work with External (Hardware) Interrupts of PIC18F4550

Interrupts are special events that require immediate attention. They cause the processor to cease the running task to serve a special task for which the interrupt event had occurred. After the special task is over, the processor resumes performing the original task. The processor can also serve these events by polling method. But polling is an inefficient technique as compared to interrupts. In the polling ...

Read more

LightKit: Pic Spoon Feed Model Railroad Lighting with Pic 12F683 12F690 and Pickit2 Video Tutorial Series

In this video series I am walking through step by step setting up from scratch to build a model railroad structure and layout lighting system that includes using the Pickit2, MPLAB and HI-Tech C. This is a complete walk through! Part 1 - http://youtu.be/DJlT0ZIQiO8 Installing MPLab and Hi-TechC / Obtaining a Pickit Programmer Part 2 - http://youtu.be/IR2s0dn-dQU General Pic information / Bread boards / Prot ...

Read more

Introduction To The PIC Microcontroller Talk video tutorial

In this talk, you are introduced to how to get started using the PIC Micro. The talk includes practical tips and ideas. In addition, the link to download all the material is here: 4shared.com/folder/2FPmwzlu/_online.html This includes beginner documentation, demo software, and additional material, like how to modify the PICKit-2 and what you'll need to get started. The key to getting started is, KEEP IT SIM ...

Read more

PIC Microcontroller Video Tutorial Series

PIC is a family of modified Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650[1][2][3] originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller".[4][5] PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, exte ...

Read more

Whistle-On Whistle-Off

This experiment turns on a LED when a whistle is detected. The LED turns off when the whistle is detected for the second time.                       ;Expt11b.asm ;Project: Whistle-On  Whistle-Off List P = 16F84 #include <p16F84.inc> __CONFIG 1Bh    ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC SetUp Delay Delay1 DelayA Look Look1 Look2 Main Main1 Main2 Main3 ORG 00 BSF 03,5 CLRF 06 MOVLW 02 MO ...

Read more

Turning on a LED using PIC16F84

This experiment turns on a LED when button A is pressed. The button is connected to the lowest bit of Port A (bit0). When the button is pressed, the line goes HIGH. This is called positive logic. The LED is connected to the lowest bit of Port B (Bit0). Any bit of any port can be an input or output. It is convenient to make port "A" an input and port "B" an output. Port A has 5 lines and port B has 8 lines. ...

Read more

External interrupt For CSS Compiler

#include <16F877.h> #device adc=8 #fuses XT,NOWDT,NOPROTECT,NOLVP #use delay(clock=4000000) #INT_EXT void EXT_ISR(void){ output_toggle(PIN_B7); delay_us(300); } void Init_MCU(void){ enable_interrupts(GLOBAL); enable_interrupts(INT_EXT); ext_int_edge(H_TO_L); set_tris_B(0x01); output_low(pin_B7); } void main(){ Init_MCU(); while (TRUE) { output_toggle(PIN_B6); delay_ms(1000); } }   ...

Read more

Analog to digital 8 bits For CSS Compiler

  #include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) #include <Lcd_4bit.c> int8 value; void main() { setup_adc_ports(AN0_AN1_AN3); setup_adc(ADC_CLOCK_DIV_2); setup_psp(PSP_DISABLED); setup_spi(SPI_SS_DISABLED); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); set_adc_channel(0); set_tris_d(0x00); set_tris_A(0xff) ...

Read more

LCD Module Display 4 line For CSS Compiler

#include <16F877.h> #device adc=8 #fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG #use delay(clock=4000000) #include <Lcd_4bit.c> int16 value1,value2,value3,value4; void main(){ setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); set_tris_d(0x00); lcd_init(); lcd_row_col(1,0); lcd_putc("Electrical Power"); delay_ms(20); lcd_row_col(2,0); lcd_putc("Loei Technical "); delay_ ...

Read more
Scroll to top