Awhile ago I got a basic POC of a Core controlling a Rover 5 unit via the Rover 5 Controller board. I want to pick up the project and interface all the I/Os into the Core (and do fancy things like PID control and Path Planning.)
My setup requires:
4 digitalWrite pins to enable the motors
4 analogWrite pins to use PWM signals to control speed
4 digital interrupts to measure the quadrature encoders
4 analogRead to measure current
I’m also using I2C to talk to other boards, like an IMU.
The problem is that I need 4 interrupts for the encoders and while the Core has 12 interrupts, I need to use 9 pins for other tasks, leaving only 3 available pins that can be attached as interrupts. Here is a diagram of my planned layout:
Also, another thread suggests the docs might lacking when it comes to interrupts. I could use another board like a Mega or not use Current Sensing (which is what I believe others have done.) Any other ideas?
I’m not sure if it’s applicable here, but have you considered a GPIO expander? There’s one in the maker kit. There should be plenty of guides available too.
Could you mux the current sensing part? I imagine you don’t need super high speed current sensing? That way you could use some of the analog ports as interrupts
I think you can make this work without the I/O expander:
Move Motor Enable from D6 to D5
Move PWM from A6 to D6
Move Encoder Interrupt 4 from D5 to A6.
You still may have some trouble though because of this:
// D0-D3 were initially chosen, but because
// individual control of dis/en'abling their
// interrupt handlers was not available, A6, A7
// D3 and D4 were chosen instead. D0, D1, D2
// A0, A1, A3, A4 are all tied to one interrupt
// handler
Sorry if I my question was not clear. Let me ask it this way.
I thought (think) that the TX is next to the Ground pin, not the RX. The pinout of the Core in this thread seems to say otherwise.