Exosite Cloud and chipKIT

chipKIT WF32 Development Board
chipKIT WF32 Development Board

Exosite has put together an open-source example application and library to help you create your own IoT application using either the chipKIT WF32 standalone or the chipKIT uC32 and chipKIT WiFi Shield together. Their example code and library show you how to access the Exosite cloud.

Check out Exosite’s support post with all the details!

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

Making Music with chipKIT


Whether it’s for the quickly approaching Halloween, or for some other event, it’s not too late to make ghoulish soundtracks or a creaky old door sounds with chipKIT.

Check out this Hackaday simple mini polyphonic synth demo for more info! Also, if you plan on using PWM, you’ll be happy to know there’s already a library written for that! Check out the PWMAudio Library for chipKIT on GitHub.

Happy Sound Making!!

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

USB Host Library Ported to chipKIT

chipKIT Uno32 with USB Host Shield
chipKIT Uno32 with USB Host Shield

Oleg Mazurov and Andrew Kroll have ported the Circuits@Home USB Host Shield 2.0 Library to chipKIT. This is the library that inspired Google to create the Android ADK (Accessories Development Kit)! With this library you can add USB Host capabilities to chipKIT Uno32 (which has none) or to chipKIT Max32 with a Network Shield, allowing for either a second USB Host port or both a USB Host and USB Device port.

Find out more about it here.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

chipKIT-compatible LCD

chipKIT-compatible LCD
chipKIT-compatible LCD

There’s a cool little LCD out there that is made for Arduino, but you too can make it work with chipKIT. You need only have the latest version of MPIDE.

  • You can buy the display here
  • The library is here (it worked no mods needed)
  • The sample code is here
Enjoy!
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

chipKIT Max32 and LED Strips

Ever wanted to integrate LED Strips into your chipKIT design? We have just the guide for you! Instructables.com has a new post about how you can do just that with a chipKIT Max32, WS2812 LEDs, and a WS2812 library for MPIDE with example code. Click the image below to see the post!

Integrate LED Strips into your chipKIT Design
VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Future online laboratories through chipKIT

A few professionals have published a research paper “A novel concept for configuring online laboratories” with the use of PIC kit in the Experiment International Conference.  (See below abstract)

They are interested in doing this with chipKIT in the future. Abstract—Embedded online laboratories are becoming frequent nowadays, because they can include both the functionality of a data acquisition device and the functionality of a webserver and this, in turn, results in lower implementation costs. However, while it is easy to configure a laboratory server which is located on a computer, the local configuration and control of an embedded laboratory is more challenging, because of the lack of interactive peripherals (such as the keyboard is to a computer). This paper introduces a novel concept which allows administrators to easily achieve the local configuration of the embedded (on-chip) laboratory parameters (including network settings) by using a mobile device.

Reference: B.Deaky, T. F. Andrade, L. Parv, “A novel concept for configuring online laboratories”, in Proceedings of the 2nd Experiment@ International Conference — Online Experimentation (exp.at’13), Coimbra, Portugal, September 18-20, 2013, pp. 79 – 82.

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

Header Files

Header files listed in alphabetical order. Files are denoted as either (AVR) or (PIC32) specific, if they apply to both platforms they are marked as (AVR|PIC32). For headers that are marked (AVR|PIC32) they can be either “generic” or “ported”. Generic files will work on either platform without modification where ported files are different for AVR or PIC32.

avr/interrupt.h (AVR)

avr/io.h (AVR)

avr/progmem.h (AVR)

avr/pgmspace.h (AVR)

Tools to access program space of the AVR processor, not needed on PIC32, but some macros can be used in its place to make AVR code run on a PIC32. <source>
  1. if defined(__PIC32MX__)
   // neither PROGMEM or PSTR are needed for PIC32, just define them as null
   #define PROGMEM
   #define PSTR(s) (s)
 
   #define pgm_read_byte(x)	        (*((char *)x))
   #define pgm_read_byte_near(x)	(*((char *)x))
   #define pgm_read_byte_far(x)	(*((char *)x))
   #define pgm_read_word(x)    	(*((short *)x))
   #define pgm_read_word_near(x)	(*((short *)x))
   #define pgm_read_workd_far(x)	(*((short *)x))

   #define	prog_void	 const void
   #define	prog_char	 const char
   #define	prog_uchar	 const unsigned char
   #define	prog_int8_t	 const int8_t
   #define	prog_uint8_t	const uint8_t
   #define	prog_int16_t	const int16_t
   #define	prog_uint16_t	const uint16_t
   #define	prog_int32_t	const int32_t
   #define	prog_uint32_t	const uint32_t
   #define	prog_int64_t	const int64_t
   #define	prog_uint64_t	const uint64_t
  1. else
  2. include <avr/pgmspace.h>
  3. endif
</source>

coffee.h

The start of all good programming sessions.

cpudefs.h

Ethernet/Ethernet.h

Ethernet/Client.h

i2cmaster.h

plib.h (PIC32)

Contains type definitions for PIC32 registers.

SdFat.h

Servo.h (?)

SPI.h (AVR|PIC32) ported

Library to provide SPI communications.

stdint.h (AVR|PIC32) ported

stdio.h

wire.h (?)

wiring.h (?)

WProgram.h (?)

 
VN:F [1.9.22_1171]
Rating: 7.0/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: -1 (from 1 vote)

Tips on porting Arduino libraries

Why do I need to port in the first place?

Arduino is many things but goal that is attempted with the project and not always accomplished is to abstract out the specific details of the Atmel microcontroller used on these boards. Abstracting out the microcontroller has a specific consequence of allowing a beginner to not have to dig in to the details of how the chip works to get a project up and running. It also has an unintended consequence of making the specific microcontroller that is used to implement a solution less relevant. Although the API (Application programmers Interface) for the Arduino is quite abstracted, some specific details within a library may not utilize these abstractions and talk directly to the chip. This can happen for several reasons. One, maybe there is no abstraction for the library writer to leverage. Two, it is difficult to use libraries within libraries in the Arduino environment (though work is on its way to resolve this). Three, there are some specific limitations of the Atmel chips that prevent “standard” C calls from being used, when this happens specific workarounds have been used. Four, C datatypes are not always consistent between compilers.

Porting Tips

When starting with a working Arduino library that you want to port to chipKIT you should have in mind the goal to keep it working on Arduino while adding chipKIT functionality. One way to do this is to make use of compiler preprocessor directives such as #ifdef to conditionally compiler for the currently selected target platform. There is detailed information on how to do this the Programming hints page.

Atmel Specific Code

When Atmel registers are used, as mentioned above, try to convert to abstractions. If this is not possible use #ifdef’s to switch between Arduino and chipKIT. For example:
#if defined(__AVR__)
    /* Atmel-specific code goes here */
#endif

#if defined(__PIC32MX__)
    /* chipKIT-specific code goes here */
#endif

Compiler Workarounds

The Atmel compiler uses some tricks for storing literal strings in program space that need to be converted to a standard C to work on chipKIT. Again, use of #ifdefs is a good way to do this. For example:
#if defined(__AVR__)
    /* Atmel-specific code goes here */
#else
    /* standard C code goes here */
#endif

C/C++ datatypes

The C/C++ programming language can be quite portable with a major exception. The size of a datatype in one compiler may not be the same a s datatype in another compiler. This is especially true when one complier is for an 8-bit architecture such as is used with Arduino Atmel chips and the other is a 32-bit architecture as is used in chipKIT PIC32 chips. For example, an int on a Atmel complier may be 16-bits and an int on a PIC32 may be 32-bits, so when an Atmel library is used on a PIC32 that relies on a int overflowing at a specific value the library will fail because of the larger storage type on the PIC32. One way to solve this problem is to use the stdint.h include that has types that call out a specific storage capacity such as the following: uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t. Example needed.
VN:F [1.9.22_1171]
Rating: 8.3/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)