Embedded

Only available on StudyMode
  • Topic: Interrupt, Microcontroller, Embedded system
  • Pages : 3 (772 words )
  • Download(s) : 370
  • Published : November 26, 2010
Open Document
Text Preview
Paper II - Section : II Embedded Systems INDEX No 1 2 3 4 5 6 7 8 9 10 Toggle Port LED Simulate Binary Counter at Port Generate delay using TIMER_0 Stepper Motor (clockwise/Anticlockwise) Generating square wave at port pin Generating Triangular wave at port pin Sine wave generation using look-up table Microcontrollers communicating over a serial link Read switch-status from i/p port and display at o/p port Using Input Capture Pin (ICP), measure pulse width & display at o/p port Topic Date 6-9-2010 9-9-2010 17-9-2010 24-9-2010 8-10-2010 15-10-2010 15-10-2010 29-10-2010 22-11-2010 24-11-2010 Page 02 03 04 06 07 09 10 11 13 15 Sign

2
Practical – 01 Toggle Port LED Aim : Write a program in embedded C programming language to alternately ON/OFF LEDs connected to 2 different ports. Components Used: i)AT90S8535 Micro controller ii)LED‟S iii)Ground Code: #include #include void main(void) { DDRA = 0xff; PORTA = 0x00; DDRB = 0xff; PORTB = 0x00; while(1) { delay_ms(100); PORTA = 0x01; PORTB = 0x00; delay_ms(100); PORTA = 0x00; PORTB = 0x01; }; } Output:

Mithibai College:-MSC COMPUTER SCIENCE PART II

3
Practical – 02 Simulate Binary Counter at Port Aim : Write a program using embedded C to simulate a binary counter. Components Used: i)AT90S8535 Micro controller ii)LED‟S iii)Ground Code: #include #include void main() { DDRA = 0xff; PORTA=0x00; while(1) { delay_ms(100); if(PORTA == 0x80) PORTA = 0x01; else PORTA += 1; } } Description: First statement a unsigned char variable (unsigned integers are used to increase the range of numbers the variable can hold) is initialized to 0x01 . port A has been set to this variable . „+‟ operator stands for bit increment operation . we are incrimenting the bit of led_status to one position of binary number when the one at lsb reaches to the msb (0x80) of the variable we reinitialize the variable to 0x01.The Delay given is of one milli second so the bit shifts after every one second(1000ms) . Output:

Mithibai College:-MSC...
tracking img