Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help need for PIC MCU

Status
Not open for further replies.

LoyC

New Member
Can an someone show me how to write a program which:
(i) Has 4 inputs of 5V on 4 different pins(Let's say PORTA),with switches on all of them.
(ii)The input control's 4 outputs(Let's say PORTB)
(ii)the output toggle each time a 5V is connected.(press switch once=1,press switch 2nd time=0)
 
The schematic diagram is as follow:

**broken link removed**

where p1.0,1.1,1.2,1.3 and p3.0 are the output pins(Lets say PORTA of the MCU). While for the input, i plan to use a 5V connected to 4 inputs(Lets say PORTB),between them there are pushbuttons.

A high state, 1 on the input will turn on p1.0 and p3.0 when the pushbutton is pushed once. The second push will turn on p3.0 but p1.0 will be turned on. The same goes with 3 other inputs, each is designed to turn on p1.1,1.2 and 1.3.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top