Jan 1

I like LED’s that indicate activity, also here a 90 degrees bended version should be used. Next to this, the type to be used should be a low current version to reduce the amount of power consumed. There are various types available, in 3mm and in 5mm. They use 2mA of current compared to normally 10 or 20, they 5mm versions have an extra mechanical snap which I guess is good for robots that run around all the time, so I will uses the 5mm versions for now.

There are two signals to monitor; the CAN frames that are send by the PMC and are address to the PMC and the commands from and to the FOXBoard. For the first one, the ATDVK90CAN1 board has two LED’s tied directly to the TXD and the RXD lines. This is not what I want since in that case it shows any CAN frame while I’m only interested in RoboCAN commands that are processed by the PMC. This will require an extra out of the AT90CAN and a software modification in the RoboCAN library. The second one is already implemented.

For the micro controller, there are three AT90CAN’s available were the main difference is in memory and price:

  • AT90CAN32, 32KB Flash, 2KB SRAM and 1KB EEPROM, 6.89 EUR at 10 units
  • AT90CAN64, 64KB Flash, 4KB SRAM and 2KB EEPROM, 7.36 EUR at 10 units
  • AT90CAN128, 128KB Flash, 4KB SRAM and 4KB EEPROM, 11.92 EUR at 10 units

The safest choice in life is always the middle one, I guess also here. Compiling the Primary Motor Cortex basic implementation that can interface with the FOXBoard and has the full RoboCAN protocol added uses 20KB of Flash and 1.6KB of SRAM. The AT90CAN32 can be used if not much additional application is added that uses variables as well. For only 0.47 EUR you can twice the amount of SRAM and FLASH, so I guess that is not worth taking the risk that the application just runs out of memory which would mean removing the part and soldering a larger on on the board. Time consuming and you risk damaging the board.

The cost adder for the AT90CAN128 is significant while only increasing the amount of FLASH. At the time of writing this, the number of code lines are:

  • CAN.c, 576 lines
  • RoboCAN.c, 885 lines
  • FOXBoard.c, 340 lines
  • Primary Motor Cortex, 213 lines

Lines of code do not directly translate to number of bytes, but for a rough estimation of how many lines the application can contain it will do: (20KB/(576+885+340+213))=10 bytes per line. 44KB/10=4500 lines of code. The largest application I wrote contained 3530 lines of code and there I was close to of-loading sub-systems to secondary micro controllers due to the complexity of the product. So using the AT90CAN64 is a safe choice for the PMC.

In order to connect the JTAG to the AT90CAN64 a 2×5 header needs to be used. Also here a 90 degrees bended version should be used so that any code can be updated later or any micro controller can be debugged later while no parts of SnakeBot have to be disassembled.

Combining all above results in the first version of the schematic. I will develop the PCB later, first the schematic should be on my desk for some days to review it several times.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.