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
please check my connections
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: please check my connections
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: please check my connections
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: please check my connections
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: please check my connections
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
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