Posts

Showing posts from June, 2022

ATMEGA328 Standalone Project

Image
Install Arduino Minicore  Open Arduino IDE Click File-Preferences Additional Board Manager URL enter the Link  //mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json click OK. Go to Tools-Boards- Board Manager type Minicore- Minicore MCU dude Version 2.1.3 click Install, After installation close and restart Arduino IDE. Circuit Diagram for Burn Bootloader to Atmega328 microcontroller Go to Tools and Follow these setting For Burn bootloader Circuit Diagram for Upload a Sketch to Atmega328 microcontroller Go to Tools and Follow the setting for Upload a sketch to Atmega 328 int del = 50; //defining delay value (0.1 second) int del1 = 1000; //defining delay value (1 second) void setup() {   // put your setup code here, to run once:   pinMode(0, OUTPUT);//defining pins (0-13) as Outputs   pinMode(1, OUTPUT);   pinMode(2, OUTPUT);   pinMode(3, OUTPUT);   pinMode(4, OUTPUT);   pinMode(5, OUTPUT);   pinMode(6, OUTPUT);   pinMode(7, OUTPUT);   pinMode(8, OUTPUT);   pinMode(9, OUTPUT);

LED Blinking with PIC16F627A Microcontroller in MPLAB IDE

Image
  #include <stdio.h> #include <stdlib.h> #include <xc.h> #define _XTAL_FREQ 2000000 __CONFIG(FOSC_HS & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & BOREN_OFF & LVP_ON & CPD_OFF & CP_OFF); void main()  {     TRISA = 0;// set all pins of Port A as OUTPUT     TRISB = 0;// set all pins of Port B as OUTPUT     while(1)// Infinite Loop to execute the code Continuously.     {      RA0=1;//Turn HIGH the Pin A0 at portA     RB0=0;//Turn LOW the Pin B0 at portB      __delay_ms(1000); //Delay 1 second     RA0=0;//Turn LOW the Pin A0 at portA     RB0=1;//Turn HIGH the Pin A0 at portB     __delay_ms(1000); //Delay 1 second     }      }

Blinking Led with PIC12F675

Image
  // CONFIG #pragma config FOSC = INTRCCLK  // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on GP4/OSC2/CLKOUT pin, I/O function on GP5/OSC1/CLKIN) #pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled) #pragma config PWRTE = OFF      // Power-Up Timer Enable bit (PWRT disabled) #pragma config MCLRE = ON       // GP3/MCLR pin function select (GP3/MCLR pin function is MCLR) #pragma config BOREN = OFF      // Brown-out Detect Enable bit (BOD disabled) #pragma config CP = OFF         // Code Protection bit (Program Memory code protection is disabled) #pragma config CPD = OFF        // Data Code Protection bit (Data memory code protection is disabled) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #define _XTAL_FREQ 4000000 #include <xc.h>  void delay_ms(unsigned int milliseconds)  {    while(milliseconds > 0)    {        __delay_ms(1);       milliseconds--;     }  }  

LED Chaser With PIC16F628A Microcontroller in MPLAB IDE

Image
 https://github.com/anokhramesh/LED-Chaser-with-PIC16F628A

Button Latch switch with PIC16877A Microcontroller in MikroC programming

Image
 https://github.com/anokhramesh/Button-Latch-Switch- https://drive.google.com/drive/folders/1L9iMF3p34olO8DLbUSlQdiDH9whV04us?usp=sharing MikroC code #define SW1 PORTD.RD4 #define SW2 PORTD.RD5 #define SW3 PORTD.RD6 #define SW4 PORTD.RD7 void main() {      TRISB = 0X00;      PORTB = 0X00;            // Clear PORTB      while(1){               if(SW1==1){                          PORTB.F0 = ~PORTB.F0;    // Toggle RB0                          while(SW1==1);     // switch debounce                          }               if(SW2==1){                          PORTB.F1 = ~PORTB.F1;    // Toggle RB1                          while(SW2==1);        // Switch debounce                          }               if(SW3==1){                          PORTB.F2 = ~PORTB.F2;     // Toggle RB2                          while(SW3==1);           // Switch debounce                          }               if(SW4==1){                          PORTB.F3 = ~PORTB.F3;      // Toggle RB3                          wh

Toggle a Relay by Single Pushbutton with Arduino

Image
//Anokhautomation //https://github.com/anokhramesh/Toggle-Relay-by-push-Button //Toggle an LED with a Push button-follow  the circuit diagram int led = 12;//connect Led to digital pin 12 of Arduino int button = 11;// connect push button to digital pin 11 of Arduino, connect a10k pull down resistance to ground . int ledState = LOW;// at initial led status is OFF int buttonCurrent;// cteaed an integer variable name buttonCurrent  int buttonPrevious = LOW;// default state of button is LOW  void setup() {   Serial.begin(9600);//baud rate of serial communication   pinMode(button, INPUT);//Pin 11 is assigned to receive an INPUT Value   pinMode(led , OUTPUT);//Pin 12 is assigned to deliver  an OUTPUT Value } void loop() {   buttonCurrent = digitalRead(button);// the variable( buttonCurrent) will store the value of button   if (buttonCurrent == HIGH && buttonPrevious == LOW)   {     if (ledState == HIGH) {       ledState = LOW;     }     else {       ledState = HIGH;     }   }   digita

LED Blink with PIC18F2220 (MPLAB IDE and XC8 compiler)

Image