Page 1 of 1

please check my connections

Posted: Tue Apr 03, 2012 4:49 pm
by Bobw
I am planning on using a 18F4455 pic.
I am working on the schematic of the electrical connections, and just want to make sure I haven't, missed something.

Switches (inputs) on RD0 thru RD6.
Relays (outputs) on RC0 thru RC2
Led (output) on RB5
Quadrature encoder on RB0 and RB3

LCD or a Glcd will be on the RA pins.

MCLR, PGD, PGC, VDD, VSS will be hooked up for pickit3 programmer.

Did I miss something?

Bob

Re: please check my connections

Posted: Tue Apr 03, 2012 5:05 pm
by Benj
Hi Bob,

I would put the Quad encoders on the upper nibble of PortB so you can use the interrupt on change functionality to automatically sample your encoders when they change state. Other then that looks ok.

Re: please check my connections

Posted: Tue Apr 03, 2012 5:11 pm
by Bobw
Ben,

Unless I miss read the data sheet, RB0, RB1, RB2 are listed as interrupts.
I thought only one of the encoder output needed to be on an interrupt?

Bob

Re: please check my connections

Posted: Tue Apr 03, 2012 5:15 pm
by Benj
Hi Bob,

You want the IOC Port change interrupt rather then the separate INT pin interrupts.

This way any change on pins RB4 - RB7 will trigger an interrupt which can then be used to call the encoder sample function.

In the datasheet refer to section 9.9

Re: please check my connections

Posted: Tue Apr 03, 2012 6:35 pm
by Bobw
Ben,
First of many thanks to come I am sure.
Yes I see it. I was only looking at the interrupt pins not the IOC pins.
Glad I ask the question now.

Bob