Skip to content

PortPSoC4

Austin Chan edited this page Dec 8, 2020 · 1 revision

The current implementation of this port file can be found here

Function Tested
InitCAN
SendCANPacket
PollAndReceiveCANPacket
getLocalDeviceSerial
getChipType

Configuration needed before using

The PSoC Port relies on using the API's Generated from the "TopDesign.cysch" of the project file. As a result, the name of the CAN block must be called "CAN".

Inside the CAN block, you must configure the following:

  • Interrupt Tab
    • Advanced interrupt configuration ✔
    • Full custom internal ISR ✔
    • Enable interrupts ✔
    • Message received ✔
  • Receive Buffers Tab
    • Set Mailbox 0-2 to basic and have IRQ checked
    • Only Set Mailbox 3 to basic and IRQ if you want the board to not filter and CAN packet and interrupt all packets sent on the bus. This is mainly used for debugging. Not recommended to have this enabled.
  • Transmit Buffers Tab
    • Check Basic for all Mailboxs

Current Implementation as of 12/7/2020

This version of the Port uses a FIFO (First In First Out) buffer that can hold any specified number of CAN Packets. Currently, it is configured to hold 16 CAN Packets.

When a CAN Packet is received, it will trigger an interrupt and store the CAN packet into the FIFO Buffer for later use.

When PollAndReceiveCANPAcket is called, it will remove the oldest element in the FIFO.