Pages: 1 [2] 3   Go Down
Author Topic: Connecting Arduino to PIC  (Read 3027 times)
0 Members and 1 Guest are viewing this topic.
Australia
Offline Offline
Sr. Member
****
Karma: 9
Posts: 418
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What exactly is the PIC supposed to do.
You have set Port A and Port E to inputs.
Are you setting all the pins of Port A and Port E to some combination of logic levels.
The code seems to need a combination of logic to make something happen.
If you set pins to input, then you must connect either a 1 or a 0 to all the pins, or enable pullups ,otherwise they will float
and give erratic results.
Logged

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Forget the circuits.
What does the PIC do when you connect the input to +5V or 0V?

(what do the PIC forums say?)

Quote
Quote
just tried it an hour ago, and it doesnt work.. tried both active low and active high..

You don't need a switch, just connect the pin to 0V or 5V. Since it's not working, as I
indicated a couple of days ago, "you might try using one of the Port B or C pins for the
input".

when i connect the pin to 5v it does what is it supposed to do..
it sends the output to the motor from portd..

Quote
OK maybe a dumb question but I have to ask anyway. You do have a common ground wire connected between the arduino and the PIC, correct?

Lefty
i powered the arduino from the vdd pin(ground) and vss pin(+5v) of the pic..
and i connected the arduino gnd to the digital gnd..

am i doing it wrong?..

« Last Edit: December 27, 2012, 05:55:49 am by siyete » Logged

Atlanta
Offline Offline
Full Member
***
Karma: 4
Posts: 128
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i powered the arduino from the vdd pin(ground) and vss pin(+5v) of the pic..
and i connected the arduino gnd to the digital gnd..

am i doing it wrong?..


vdd is normally +v, vss is normally 0v
Logged


Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i powered the arduino from the vdd pin(ground) and vss pin(+5v) of the pic..
and i connected the arduino gnd to the digital gnd..

am i doing it wrong?..


vdd is normally +v, vss is normally 0v

sorry i got it backwards, anyway is the wiring supposed to be like this:

im having doubts on using the pic pin as gnd so using the supply gnd will do right?..
Logged

Atlanta
Offline Offline
Full Member
***
Karma: 4
Posts: 128
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

remove the link from "Input to pic" and "gnd"
Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 332
Posts: 16568
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i powered the arduino from the vdd pin(ground) and vss pin(+5v) of the pic..
and i connected the arduino gnd to the digital gnd..

am i doing it wrong?..


vdd is normally +v, vss is normally 0v

sorry i got it backwards, anyway is the wiring supposed to be like this:

im having doubts on using the pic pin as gnd so using the supply gnd will do right?..

Well that drawing shows correct common grounding between the arduino and the PIC, but it also shows a permanent ground wired to the PIC input pin, which is certainly incorrect.

Lefty
Logged

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i powered the arduino from the vdd pin(ground) and vss pin(+5v) of the pic..
and i connected the arduino gnd to the digital gnd..

am i doing it wrong?..


vdd is normally +v, vss is normally 0v

sorry i got it backwards, anyway is the wiring supposed to be like this:

im having doubts on using the pic pin as gnd so using the supply gnd will do right?..

Well that drawing shows correct common grounding between the arduino and the PIC, but it also shows a permanent ground wired to the PIC input pin, which is certainly incorrect.

Lefty

ok i finally got it to work using that wiring, but you said incorrect can i know where i should place the common ground?..
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 332
Posts: 16568
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ok i finally got it to work using that wiring, but you said incorrect can i know where i should place the common ground?..

Hard to understand what you are saying. Can you post a new drawing of how you have it presently wired and working?


Lefty
Logged

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

got it to work using this:


you said it was incorrect due to the pic input being permanently grounded, so where should i place the common ground?..
« Last Edit: December 27, 2012, 09:49:03 am by siyete » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 241
Posts: 24480
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
got it to work using this:
I don't think so.

See that node labelled "Input to PIC", and the one labelled "PIC PSU Gnd" and that solid black line that connects the two?
That's why it doesn't work.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
got it to work using this:
I don't think so.

See that node labelled "Input to PIC", and the one labelled "PIC PSU Gnd" and that solid black line that connects the two?
That's why it doesn't work.

i guess but im not sure if your saying i should do
"arduino output<resistor<pic input" and a different connection for the common ground?..
tried using vss for common ground but i dont know why it doesnt work..
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 241
Posts: 24480
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That schematic is grounding your PIC input - that's a solid "LOW" on that input.
Connect the grounds together, but don't short an input to ground.
(unless it says "unused inputs should be tied to ground" somewhere in the datasheet. This is clearly not unused, because it is connected to an output from the Arduino.)
If you want a series resistor, I guess that's OK.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

im really confused now, can you show me a schematic of the wiring on how i can connect the output from arduino to the input of the pic?..
it tried connecting it directly and it doesnt work.. can you please show me how.. do i need a transistor?..

will something like this work:
or
« Last Edit: December 31, 2012, 07:28:17 am by siyete » Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't been following this thread lately, but somehow the replies have gotten you
completely confused. In fact, your original ckts in posts #8 and #11 are ALL correct,
and since then, they are all wrong.

However, you possibly did not have a ground wire connected between the 2 processor
boards originally. So, forget everything else, and go back to your original ckts, and
where it says Gnd, just make sure that point goes to the grounds on both boards.
Logged

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

need help again, i dont know if its my wiring or whathever but my arduino is rebooting/restarting..
im using this wiring:
http://i46.tinypic.com/51dopu.jpg

a 12v battery powers my pic16f877a and my arduino so that covers the common ground right?..

i cant pinpoint the reason why it is restarting..

1. power is not enough?..
2. my wiring is wrong so its rebooting?..
3. arduino low memory so its restarting?..
4. my arduino is damaged?..
5. any other reason you can think of...

need help.. thanks..
Logged

Pages: 1 [2] 3   Go Up
Jump to: