Wednesday, September 2, 2020

Embedded Essays

Inserted Essays Inserted Essay Inserted Essay 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 postpone utilizing TIMER_0 Stepper Motor (clockwise/Anticlockwise) Generating square wave at port pin Generating Triangular wave at port pin Sine wave age utilizing look-into table Microcontrollers conveying over a sequential connection Read change status from I/p port and show at o/p port Using Input Capture Pin (ICP), measure beat width show 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 Practical †01 Toggle Port LED Aim : Write a program in implanted C programming language to then again ON/OFF LEDs associated with 2 distinct ports. Parts Used: i)AT90S8535 Micro controller ii)LED? S iii)Ground Code: #include void main(void) { DDRA = 0xff; PORTA = 0x00; DDRB = 0xff; PORTB = 0x00; while(1) { delay_ms(100); PORTA = 0x01; PORTB = 0x00; dela y_ms(100); PORTA = 0x00; PORTB = 0x01; }; } Output: Mithibai College:- MSC COMPUTER SCIENCE PART II 3 Handy †02 Simulate Binary Counter at Port Aim : Write a program utilizing inserted C to recreate a double counter. Segments Used: i)AT90S8535 Micro controller ii)LED? S iii)Ground Code: #include void primary() { DDRA = 0xff; PORTA=0x00; while(1) { delay_ms(100); if(PORTA == 0x80) PORTA = 0x01; else PORTA += 1; } Description: First explanation an unsigned singe variable (unsigned whole numbers are utilized to expand the scope of numbers the variable can hold) is introduced to 0x01 . port A has been set to this variable . „+? perator represents bit increase activity . we are incrimenting the bit of led_status to one situation of double number when the one at lsb compasses 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 each one second(1000ms) . Yield: Mithibai College:- MSC COMPUTER SCIENCE PART II 4 Practical †03 Generate postpone utilizing TIMER_0 Aim : Write a program utilizing imp lanted C to create defer utilizing TIMER0. Parts Used: i)AT90S8535 Micro controller ii)LED? S iii)Ground Code: #include int timeCount = 0; interrupt[TIM0_OVF] void timer0_ovf_isr(void) { TCNT0 = 6; if(++timeCount == 1000) { PORTA =PORTA ^ 0x01; timeCount = 0; } void main(void) { DDRA = 0x01; PORTA = 0x01; TCCR0 = 0x02; TIMSK = 0x01; #asm(sei); while(1); } Description: A variable timecount is introduced to 0. In the principle work the LSB of PORTA is picked for yield and it is set to 1. At that point the TIMER COUNTER CONTROL REGISTER (TCCR0) is introduced so that partition by 8 (CK/8)clock source is chosen again the â€Å"timer interfere with veil is set to empower the timer0 counter. #asm† is a low level computing construct guidance „sei? represents set empower hinders to empower all the interferes. Finaly ainfinite while circle. At that point the capacity with keword hinder is made. This capacity will be called consequently when the timer0 flood interfere with happens. This capacity returns nothing, since it isn't called by any capacity and you cannot pass an ything to work for a similar explanation . The timer0 is instated to 6 in this capacity . As we have picked ck/8 framework as referenced above and the clock recurrence is 4 Mhz that? s why 4/8 Mhz so 500 Khz(0. Mhz) will be the powerful recurrence so for one tick of counter 1/0. 5 miniaturized scale sec are required(1/freq. = time) that equivalents to 2 small scale secondes. A clock can tally 256 that? s why aggregate of 256*2 that is 512 miniaturized scale seconds are required . So to make it a round figure I. e. 500 microsecs we Mithibai College:- MSC COMPUTER SCIENCE PART II 5 need to discard 6 ticks of counters that is the reason we set clock (TCNT0 =6) to 6 with the goal that it ticks from 6 to 256 henceforth ticks viably for multiple times (250*2 = 500). what's more, covers 500 miniaturized scale secs ,when timecount is augmented up to 1000 (1000*500 smaller scale secs = 0. secs). What's more, drove flips after 0. 5 secs. Yield: Mithibai College:- MSC COMPUTER SCIENCE PART II 6 Practical †04 Stepper Motor (Clockwise/Anticlockwise) Aim : Write a program utilizin g inserted C to recreate Stepper Motor(Clockwise/AntiClockwise). Parts Used: i)AT90S8535 Micro controller ii)LED? S iii)Ground iv)STEPPER MOTOR Code: #include unsigned scorch motorStatus = 0x01; void main(void) { DDRA = 0x0f; DDRB = 0x0f; #asm(sei); while(1) { PORTA = motorStatus; PORTB = motorStatus; delay_ms(200); motorStatus

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.