Well, for starters there are problems with the Arduino CAN bus library, as ANY node in the system can be a master or a slave. Currently, the Arduino CAN supports a SLAVE - MASTER, relationship. On the MCP2515_CAN module, you have the following connection on the header, plus outputs High and Low. So with what little time I have remaining. I just will be sending and receiving messages via the USB port using CANaerospace formatted messages.
SIGNAL | MODULE | MEGA PIN | ICSP | Definition |
---|---|---|---|---|
MOSI | SI | 51 | 4 | Master Out / Slave In |
MSO | SO | 50 | 1 | Master Slave Out |
SCLK | SCK | 52 | 3 | System Clock |
CS | CS | 53 | Slave Select | |
INT |
The Fuel Load Indicator has two switches:
1. UP / DOWN switches control which fuel tank is being filled or the current value of the selected tank. This is a circular list.
2. Fill controls the filling of the selected tank (see switch 1)
3. TEST position tests the system when selected both displays will turn on both displays.
After TESTING the upper display will display total fuel load in pounds, the lower display will display the tank number and US Gallons.
There can be up to eight (8) tanks with CAN identifiers 668 - 675 with fuel total identifier at 1301. The Fule Load Indicator must also respond to IDS (node 0) Identification service. Requests a "sign-of-life" response together with the configuration from the addressed node.
Now back to the switches. I plan on using an SN74LS148 an 8 input to 3 BCD priority encoder. A nice feature of the encoder it has an extra output EO since all of the switches are pulled up EO = LOW, when a switch is energized EO = HIGH. The EO output is input to an SN74LS14 hex Schmitt-Trigger. The output of the Schmitt-Trigger is pin number 3 on the Arduino's Interrupt Pin.
Afterthought:
- Please Note that pin Interrups value equals 3 and the name of the interrupt is ISR3. This keeps things straight in my mind.
- I could use bit manipulation:
valA = digitalRead (pinA );
valB = digitalRead (pinB );
valB << 2;
valC = digitalRead (pinC );
valC << 3;
testValue = valA + valB + ValC;
switches ( testValue );
// in setup |
// in setup |
Top Comments