Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help needed for PIC mcu

Status
Not open for further replies.

LoyC

Junior Member level 1
Joined
Mar 1, 2011
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,410
can 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)
 

Why would you need a microcontoller for such task?

quad D-type flip-flop + inverter or simply J-K-type flip-flop would function same as well. These ic's can be found in popular 7400 and 4000 families
 

hi

which language you want to make the program?


ml
 

Why would you need a microcontoller for such task?

quad D-type flip-flop + inverter or simply J-K-type flip-flop would function same as well. These ic's can be found in popular 7400 and 4000 families

It's because of my project requirement.

---------- Post added at 10:37 ---------- Previous post was at 08:55 ----------

hi

which language you want to make the program?


ml

C language mate!
 

hi

if it's c, it's easy
just do the initialization part like configure pins as inputs and outputs

if(input1 == 1){
output1 ^= 1;
}
put appropriate delay between reading of switches to avoid de-bounsing
is it ok?

ml
 

hi

if it's c, it's easy
just do the initialization part like configure pins as inputs and outputs

if(input1 == 1){
output1 ^= 1;
}
put appropriate delay between reading of switches to avoid de-bounsing
is it ok?

ml

Mate, i think u got it wrong by what i mean. i need the same input of 1 to give 2 outputs.

The schematic diagram is as follow:



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.

Btw, thx for trying to hep!!
 

hi

i think i got what you said
i posted a part of the program which contains the idea of writing the rest
i thought you can fill the blanks
what do you want?
you want me to write the entire code?


ml
 

hi

i think i got what you said
i posted a part of the program which contains the idea of writing the rest
i thought you can fill the blanks
what do you want?
you want me to write the entire code?


ml

Sry mate, i just got confused with your code...nono, of course i don't want the entire code. Anyway, thx.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top