





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Embedded and Real Time Systems Assignment 03
Typology: Assignments
Uploaded on 01/13/2021
3 documents
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Code: - #include <avr/io.h> int main(void) { /* Replace with your application code */ DDRB=0xFF; while (1) { PORTB=PORTB | 0b10001000; PORTB=PORTB & 0b01110111; } return 0; } OUTPUT: -
return 0; } OUTPUT: - Proteus Simulation: -
Question 3: -
#include <avr/io.h> int main(void) { /* Replace with your application code */ unsigned char bcdbyte; unsigned char w='2'; unsigned char z='9'; DDRA=0xFF; w=w & 0x0F; w=w<<4; z=z & 0x0F; bcdbyte=w | z; PORTA=bcdbyte; return 0; } OUTPUT: -
#include <avr/io.h> int main(void) { /* Replace with your application code */ while (EECR & (1<<EEWE)); EEDR= 'Ukasha Javed'; EECR |= (1<<EEMWE); EECR |= (1<<EEWE); return 0; }
#include <avr/io.h> int main(void) { /* Replace with your application code */ DDRB=DDRB & 0b11011111; DDRD=DDRD | 0b00000100; while (1) { if ( PINB & 0b00100000) PORTD =PORTD | 0b00000100; else PORTD=PORTD & 0b0111111; } return 0; }