Esseries1 24-25 With Scheme
Esseries1 24-25 With Scheme
EMBEDDED SYSTEMS
PART A 4
I. 1 Unsigned char, char, unsigned int, int, float, double (any two) 1
I. 4 Status register 1
PART B
4
int main(void)
{
DDRC = 0xFF; // initialize port as o/p
while(1)
{
// LED on
PORTC = 0xFF; // PC = High = Vcc
//LED off
PORTC = 0x00; // PC = Low = 0v
}
}
II. 7 32K bytes of In-System Programmable Flash Program memory with Read- 6*.5 3
While-Write capabilities
1024 bytes EEPROM
2K byte SRAM
32 general purpose I/O lines
On-chip Debugging support and programming
Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture Mode
Real Time Counter with Separate Oscillator
Four PWM Channels
8-channel, 10-bit ADC
Any 6
PART C 7
III. 9 3 7 7
III. 10 Program to convert a packed BCD data byte to ASCII and display the 7 7 7
bytes on port b and port c
#include <avr/io.h>
int main(void)
{
unsigned char x, y;
unsigned char mybyte = 0x29; //data
DDRB = DDRC = 0xFF; // o/p ports
x = mybyte& 0x0F;
PORTB = x | 0x30;
y = mybyte& 0xF0; //upper digit
y = y >> 4;
PORTC = y | 0x30; // lower byte
return 0;
}