use 8051 Keil Assembler as microwave oven use downcounter to
use 8051 Keil Assembler, as microwave oven use down-counter to keep track of action. write program to make a down-counter using MDE8051 trainer, it should show the binary count on LEDs, modify program to set the start count to 20 as follows, change the minimum count to the value of the month you were born and observe the LED counting down to that number.Which port was used to display the count?which one was used to set the minimum count? can we use port for both( inputting the maximum count and displaying the count)?
Solution
#include <8051.h>
void main (void)
{ unsigned char i; // The loop counter
while (1) // Most all embedded programs require this
{
for (i=0; i<100; i++) // Loop from 0 to 99
{
display_write(i); // Send value of i to the display
delay_ms (250); // Delay for 250 milliseconds
}
}
}
display_write is a function you create to send the number to the 7-segment display. delay_ms is a function you create that delays the specified number of ms--so the display doesn\'t count too fast to read.
The display_write function MIGHT look like this:
