SundusHamideh
Newbie level 3
Hey All,
I was asked to do the following task:
I should connect two pics of type 16F84A in parallel, usart isn't allowed
This embedded system has two microcontrollers; MC1 and MC2. These two microcontrollers operate as follows:
1) MC1 is connected to three switches and one pushbutton, and is running at 10 KHz.
The switches are read every 1 second and communicated to MC2 using PORTA. The time to read the switches is generated using Timer 0 module interrupt. The pushbutton that is connected to RB0 is used to control whether MC1 sends the value that is read from the three switches or not. Effectively, when the system is started, MC1 sends the switches value by default. However, upon the arrival of the first external interrupt, MC1 will always send 3 to MC2, regardless of the switches value.This situation continues until the arrival of the next external interrupt where MC1 goes back to sending whatever it reads from the three switches. In other words,MC1 toggles this state between successive external interrupts.
2) MC2 is also running at 10 KHz and is connected to a switch and 6 LEDs that are arranged in a ring. MC2 continuously receives the value of the switches from MC1.
The received value determines the number of LEDs that are flashed every 0.25 seconds. If the received value is 0 or 7, then there is no flashing and all LEDs are off. The switch that is connected to MC2 determines whether MC2 should flash the LEDs or not. Effectively, when the value that is read from the switch is logic high, there is no flashing and all LEDs are on regardless of the values received from MC1.
Otherwise, the LEDs are flashed according to the received value.
Note: MC2 does not use any source of interrupts, i.e. all operations are performed using polling.
The program must be written using assembly language,not c or any other language !
I was asked to do the following task:
I should connect two pics of type 16F84A in parallel, usart isn't allowed
This embedded system has two microcontrollers; MC1 and MC2. These two microcontrollers operate as follows:
1) MC1 is connected to three switches and one pushbutton, and is running at 10 KHz.
The switches are read every 1 second and communicated to MC2 using PORTA. The time to read the switches is generated using Timer 0 module interrupt. The pushbutton that is connected to RB0 is used to control whether MC1 sends the value that is read from the three switches or not. Effectively, when the system is started, MC1 sends the switches value by default. However, upon the arrival of the first external interrupt, MC1 will always send 3 to MC2, regardless of the switches value.This situation continues until the arrival of the next external interrupt where MC1 goes back to sending whatever it reads from the three switches. In other words,MC1 toggles this state between successive external interrupts.
2) MC2 is also running at 10 KHz and is connected to a switch and 6 LEDs that are arranged in a ring. MC2 continuously receives the value of the switches from MC1.
The received value determines the number of LEDs that are flashed every 0.25 seconds. If the received value is 0 or 7, then there is no flashing and all LEDs are off. The switch that is connected to MC2 determines whether MC2 should flash the LEDs or not. Effectively, when the value that is read from the switch is logic high, there is no flashing and all LEDs are on regardless of the values received from MC1.
Otherwise, the LEDs are flashed according to the received value.
Note: MC2 does not use any source of interrupts, i.e. all operations are performed using polling.
The program must be written using assembly language,not c or any other language !