sam_kevin
Junior Member level 1
- Joined
- Jan 21, 2013
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,429
Hi Friends
can you please guide me for writing code on 89c51 mcu, I designed the whole circuit, but programming mcu is new to me.
The instruction list is listed below
2. When the microcontroller is powered ON, all pins of port 0 and 2 should be pulled to low.
3. Port -0.0 (pin no 39) will act as a main switch, If Port -0.0 becomes high, then port – 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 and Port – 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 should pulled to high. But P-0.7 and P 2.7 will remain low.
4. While Input P0.0 remains in high status, When Input P0.1 gets low pulse then output P2.1 should pulled to low permanently, and there should be no effect occurred on P2.1 even when input P0.1 keeps changing its status (low or high)
5. Step 4 will be applied for input P (0.1 to 0.6), (Input P 0.1 will drive output P 2.1, Input P 0.2 will drive output p2.2........................... and Input P 0.6 will drive output P 2.6 )
6. Finally P2.0 will turn low when all the output pins from P 2.1 to 2.6 gets low. Till then P 2.0 will remain in high status
2. While Input P0.0 remains Low, When Input P0.7 gets low pulse then output P2.7 should pulled to low permanently, and there should be no effect occurred on P2.7 even when input P0.7 keeps changing its status (low or high)
3. Once p2.7 pulled to low, immediately p2.0 should pulled to low.
can you please guide me for writing code on 89c51 mcu, I designed the whole circuit, but programming mcu is new to me.
The instruction list is listed below
Instruction list for programming 89c51 microcontroller
Case-1
1. Port – 0 and Port – 2 is used in this project, all 8 pins of port 0 is assigned as input and all 8 pins of port – 2 is assigned as output2. When the microcontroller is powered ON, all pins of port 0 and 2 should be pulled to low.
3. Port -0.0 (pin no 39) will act as a main switch, If Port -0.0 becomes high, then port – 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 and Port – 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 should pulled to high. But P-0.7 and P 2.7 will remain low.
4. While Input P0.0 remains in high status, When Input P0.1 gets low pulse then output P2.1 should pulled to low permanently, and there should be no effect occurred on P2.1 even when input P0.1 keeps changing its status (low or high)
5. Step 4 will be applied for input P (0.1 to 0.6), (Input P 0.1 will drive output P 2.1, Input P 0.2 will drive output p2.2........................... and Input P 0.6 will drive output P 2.6 )
6. Finally P2.0 will turn low when all the output pins from P 2.1 to 2.6 gets low. Till then P 2.0 will remain in high status
Case-2
1. When Input P0.0 becomes low, all the pins of port 0 and port 2 should be pulled to low except P0.7, P2.0 and P2.7 should remain high.2. While Input P0.0 remains Low, When Input P0.7 gets low pulse then output P2.7 should pulled to low permanently, and there should be no effect occurred on P2.7 even when input P0.7 keeps changing its status (low or high)
3. Once p2.7 pulled to low, immediately p2.0 should pulled to low.