This guide should help you map the capabilities of the CANFDuino to the pad connections on the PCB. It is also important to reach the description of functions below the numbered photo as there are some important points about the operation of the bootloader, multi-use pins and information on voltage and current ratings (NOTE THIS IS A 3.3V PART). Sample code for testing and using these IO is found on github.
Features and Associated PCB Connections
Feature | PCB connections |
---|---|
CAN & CANFD Connections | DB9 connectors & breakout pads (2-CANL, 3- GND, 7 – CANH) CAN0 +12V DC input v1.2 or higher |
Analog Inputs | A0-A9 |
PWM Outputs | A0,A1,D12,D13,D14,D15,D17,D18,,D19,D21,D22,D23,D24,D25 |
SPI (SD Card) | D12 MOSI, D13 MISO, D14 CS, D15 SCK |
Serial2 | D10 TX, D11 RX |
Serial3 | D24 TX, D25 RX |
2WIRE (I2C) | A8 SDA, A9 SCL |
LED | D28 |
Digital IO | A0-A9, D10-D15, D17-D25 |
Boot Pin | D16 |
Visual Guide To Functions
1. – Bootloader Bypass
Jumper this to bypass the SAMBA bootloader from the Arduino IDE. Each time the CANFDuino is powered up or when serial communications is initiated (asserting the DTR line of FTDI 231 IC connected to SAMC21) the processor will enter the bootloader mode for a few seconds before jumping into your application code. This is done so the Arduino IDE has time to upload code when the “upload” button is pressed from the IDE. If you are “done” with your coding and do not want CANFDuino to delay each time it is reset, jumper these pads together and CANFDuino will jump straight into execution (you also will not be able to upload code). When in bootloader mode, the GP LED stays on and rapid blinks off about once a second until entering the application code.
2. – 120Ohm CAN Terminations
Jumper these pads together if you would like to use the on-board terminations for CAN0 or CAN1. CAN and CANFD require a termination at each end of the network (read how to properly wire a CAN bus).
3. –Optional CAN Connections
2.54mm spaced pads for connection to CANH, CANL, GND for CAN0 and CAN1 in the case that the DB9 breakout is not used. Handy for breadboard style jumpers.
4. – Analog Inputs
Pins 0 – 9 can be used as 10 analog inputs for the onboard 12bit ADC’s of the ATASAMC21 M0 (3.3 reference by default). Alternatively they can also serve as general purpose digital IO. See example analog input code in github repository..
5. – Digital IO
Pins 10 – 25 Can serve as general purpose digital IO OR PWM, UART, SPI and I2C. Sample code is provided for each of these in the github repository The Pin mapping is (note some analog pin overlap):
- SPI (SD card): D12 MOSI, D13 MISO, D14 CS, D15 SCK
- PWM: A0,A1,D12,D13,D14,D15,D17,D18,,D19,D21,D22,D23,D24,D25
- SERIAL2: D10 TX,D11 RX SERIAL3: D24 TX,D25 RX
- I2C (2WIRE): A8 SDA, A9 SCL
6. – General Purpose LED
D28 is connected to an LED for general purpose signaling and debug in application code (LED bulletin). When in bootloader mode, this LED stays on and rapid blinks off about once a second until entering the application code.
7. – RX & TX LEDs
These LED’s are connected to the FTDI USB to UART bridge and are simply used as an indicator when the CANFDuino is sending or receiving data to the PC via USB.
8. – SWD connection (in circuit debugging)
This is SWD in-circuit emulator/programming connection to the SAMC21. Can be used to program and debug the CANFDuino in IDE’s such as Microchip’s ATMEL studio programming environment.
9. – Breakouts
Use these pads to jump signals “into the real-world” to the 12pin terminal block from the prototyping space inside the enclosure.
10. – Removable SD Card
Read and write to this SD card over SPI using the standard Arduino libraries. See example code for reading and writing to SD card and logging CAN bus data on github the OBD2 logger example code.
11. – Through-Hole and Surface Mount Prototyping Space
Add circuitry to the CANFDuino to take it to the next level. Add driver IC’s, wireless capability, filter and divider circuitry etc. using the PCB space provided and 3.3V and 5V power and ground rails. Note the SAMC21 is operating as a 3.3V IC, as such the signals interfaced should also be 3.3V to avoid damage. The 3.3V regulator is rated up to about 300mA, however consideration for thermal overloads and transients should be made. The 5V area is supplied by the USB power connection. Note it is possible to use the breakouts (9) to supply an external 5V source to these pads for powering the CANFDuino, or alternatively add higher voltage regulator circuitry to the prototyping space.
12. – CANFD Ports
Upper port 0, lower port 1. Pin 2 – CAN L, Pin 3 – GND, Pin 7 -CAN H, CAN0 Pin 9 – 12VDC input on v1.2 or higher. All other pins NC