Introducing the Basic I/O Shield

Many-projects-of-the-chipKIT-IO

Digilent has posted an excellent introduction to the chipKIT Basic I/O Shield on their blog. It starts with a video that describes the general features of the board, and shows how to download the software library and documentation. The post also includes 4 sample projects that demonstrates how to get started using the board.

The Basic I/O Shield is designed to work with the chipKIT Uno32, uC32, and Max32 base boards. For more information, check out the blog post here:

http://blog.digilentinc.com/index.php/getting-busy-with-projects-and-the-chipkit-basic-io-shield/

VN:F [1.9.22_1171]
Rating: 7.2/10 (6 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)

chipKIT Max32 Modification for 5V Operation

chipKIT Max32 Modification for 5V Operation
chipKIT Max32 Modification for 5V Operation

OK, so the title of this post is a bit misleading, since the chipKIT Max32 already includes a fairly sophisticated power supply. It has both 3.3V and 5V regulators on board, auto-switches away from USB power when an external supply is connected, and can be jumpered for an external regulated supply. Turns out there is one use case that is not handled automatically: When an external regulated 5V supply and a USB cable are connected at the same time, the auto-switch is inhibited.

EE Times editor Max Maxfield explores a scenario in which multiple boards (an Arduino Mega, chipKIT Max32, and a bunch of NeoPixel strips) are connected together and driven from a single, 5V regulated supply. For all the details, please see the article on EE Times where on the second page of the article you will find the instructions for how to modify the chipKIT Max32 board. Incidentally, the mod for chipKIT Max32 is much simpler than for Arduino Mega. Fun!

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Migrate Arduino/chipKIT Code to MPLAB XC32

blink_sketch Tom Kibalo has posted a tutorial that demonstrates how Arduino/chipKIT sketches can be converted into traditional PIC32 projects using the MPLAB XC32 compiler and Microstick II development board. In the article common operations are converted into C code using a beta compatibility library that he developed.

Check out the article at circuitcellar.com
VN:F [1.9.22_1171]
Rating: 8.5/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Efficient Use of C++ in Embedded Systems

Those of you planning to begin a project in using C++, hopefully using the MPLAB XC32++ compiler or the chipKIT platform, already know about the object-oriented programming concept of polymorphism. Essential to polymorphism is the concept of a virtual method, a method whose behavior can be overridden within an inheriting class by a method with the same signature.

Virtual methods are implemented using a virtual method table (vtable). The compiler creates a vtable for each class. When an object is created, a pointer to this table is added as a hidden member of the object. The compiler also generates code to initialize the vpointers of its objects to the address of the corresponding vtable. When designing your classes for your embedded application, you will want to keep the extra overhead of the vtable in mind.

Along the same lines, as an embedded-systems developer, you may be surprised by the overhead required by a pure virtual method, since it has no implementation and can therefore never be called directly. Well, the compiler generates error-handling code to handle the case where a pure virtual function is called. In the current XC32 v1.20 compiler release, when a pure virtual method is called, an error message is printed and a C++ exception is thrown, bringing in a fairly large amount of code that should never be executed. While the error handling is useful, we plan to look into simplifying it in future compiler releases to reduce the overhead. For now, you will find that avoiding a pure virtual method will help keep your code size down.

A pure virtual method assigns the function the value 0 rather than providing an implementation. For example:

class Base
{
public:
const char* SayHi() { return "Hi"; } // a normal non-virtual method
virtual const char* GetName() { return "Base"; } // a normal virtual method
virtual int GetValue() = 0; // a pure virtual method
};

To avoid the extra overhead, provide a default implementation like this:

class Base
{
public:
const char* SayHi() { return "Hi"; } // a normal non-virtual method
virtual const char* GetName() { return "Base"; } // a normal virtual method
virtual int GetValue() { while(1); /* Error */ } // a normal virtual method
};

Another hidden consumer of Flash space to look out for is Run-Time Type Information (RTTI). This C++ mechanism exposes information about an object’s data type at runtime. The dynamic_cast<> operation and typeid operator are part of RTTI. When this feature is enabled, additional the type information gets stored in Flash and can consume space even when the application does not use it. When you’re not using RTTI, be sure to disable it in your project settings (-fno-rtti). This compiler option can be added to the chipKIT IDE (MPIDE) default compiler option in <install_dir>/hardware/pic32/platforms.txt

C++ exception handling also causes additional code to be generated. Although exceptions provide a way to react to exceptional circumstances (like runtime errors) in an application, they come at a fairly substantial code and data memory cost. When your application doesn’t require exception support, you can disable it in your project settings (-fno-exceptions). This option is specified by default when the chipKIT IDE (MPIDE) invokes the chipKIT compiler.

[ Thanks to Jason Kajita for this helpful information ]
VN:F [1.9.22_1171]
Rating: 9.3/10 (4 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

NKC ProtoShield Kit for chipKIT Uno32

This article describes an expansion board kit available from NKC Electronics for the chipKIT Uno32 Development Board.

What is a Proto Shield? We all know that the Shields are from the Arduino world and they are named after the little boards that sits on top of the Arduino and compatible boards. A Proto Shield is a combination of a ProtoBoard with a Shield. You usually use a Bread Board to build a prototype, to test the design. Once you have it working and want to house it in a more permanent board, is where a Proto Shield shows its benefits.

The ProtoShield for the chipKIT Uno32 is an exclusive design of NKC Electronics, and it has many nice features:

NKC_protoshield_image_1

The fully assembled ProtoShield board looks like this:

NKC_protoshield_image_2

The kit includes the board and many extra components. What you finally end up installing on the ProtoShield will be based on your requirements. But in general, I recommend soldering all the female headers, as they are needed to bring all the signals and POWER from the chipKIT Uno32 board to the ProtoShield.

NKC_protoshield_image_3

The LED with the associated resistor and filtering capacitor is to add a POWER indicator, meaning you have 5V power from the chipKIT Uno32 board to the ProtoShield.

NKC_protoshield_image_4

The RESET switch is necessary if you want to reset the chipKIT Uno32 board from the top.

NKC_protoshield_image_5

The little 6-pin male header with the 2 jumpers are used to configure how you want to use the 2 power BUSES in the middle of the board. You can send +5V to one of them, GND to the other, or +5 or GND to both of them at the same time.

NKC_protoshield_image_6

If you use the 6-pin male header jumpers to power the BUS, then you can only have +5V.

If you need the full ProtoShield to be 3.3V, then you can select one of the jumpers to GND and the other one open and connect +3.3V directly to the positive BUS. Take a look at the diagram below:

NKC_protoshield_image_7

For more information, visit NKC Electronics Protoshield Kit for chipKIT Uno32

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)