MikroElektronika Buggy: Arduino programming #2


So, after posting the Arduino IDE pin chart for the Clicker2 for PIC32MX, taking full advantage of the new chipKIT core v.1.3.1 it’s time now to revisit the Buggy. In this blog post I will publish an updated pin chart, and a new set of definitions to make the Buggy work in Arduino IDE.

This blog post is more than two years old.

So, first the pin chart, as usual available also in pdf format for download:

Buggy + Clicker2 for PIC32MX: Arduino IDE pin chart

Buggy + Clicker2 for PIC32MX: Arduino IDE pin chart

As one can see, this builds upon the previous pin chart for Clicker2 for PIC32MX, adding one extra level of pin definitions for the Buggy. Obviously, these definitions must be added to your Arduino sketch. I do prefer to put  these definitions is a separate header file, which is later included in the sketch:

Just create an empty .h file and put the above definitions in it. Include the file in your sketch and you are ready to go.

Just to show you how simple is this, here’s a small sketch that blinks the lights:

A few particularities

In the current board version for the Clicker2, the INT5 is not defined properly. As such, click boards placed in the rear socket might have problems when using interrupts.

Communication lines are shared between the click sockets. SPI will work fine, as there are separate CS lines for each click socket. I2C lines are also common to all mikroBUS sockets. Conflicts will appear if click boards having the same I2C address are used. UART lines are also shared by all click boards in the Buggy, as well by the mikroBUS socket #2 on the Clicker23 board. Only one click board that uses UART communication can be used.

There is a digital input pin that detects the presence of USB power for the socket on the Buggy. One can use this pin to stop the current program while power is applied to the Buggy (usually for charging the battery).

There’s a pin indicating charging status.There’s also an analog pin for reading the battery voltage.

Motors are driven by DRV8835. The truth tables for driving the motors are in the datasheet.

All pins except analog inputs are 5V tolerant.


Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.