Category Archives: Tutorial AVR C Codevision

2.1. Experiment to read data from PORTB and outpu to the PORTC

# include <mega8535.h> # include <delay.h> void main(void) { DDRB=0×00; PORTB=0xFF; DDRC=0xFF; #asm(“nop”); while (1) { PORTC=PINB; }; }

Posted in Tutorial AVR C Codevision | Leave a comment

1.3. Experiments turn on the LED and the shift to right

In this experiment an LED that is connected to PORTC will be turned on alternately # include <mega8535.h> # include <delay.h> int temp; void main(void) { DDRC=0xFF; temp=1<<7; //bit ke-7 diberi logika 1 PORTC=~temp; delay_ms(100); while (1) { // Place … Continue reading

Posted in Tutorial AVR C Codevision | Leave a comment

1.2. Experiment to turn on/off using BIT

In this experiment led is connected to PORTC will be turned on and off with the instruction BIT # include <mega8535.h> # include <delay.h> // Declare your global variables here void main(void) { DDRC=0XFF; while (1) { // Place your … Continue reading

Posted in Tutorial AVR C Codevision | Leave a comment

1.1. Experiment turn on/off LED

In the following experiment portC functioned as an output and eight LED will turn on and off continuously, using delay subrutine. # include <mega8535.h> # include <delay.h> // Declare your global variables here void main(void) { PORTC=0XFF; while (1) { … Continue reading

Posted in Tutorial AVR C Codevision | Leave a comment