Archive for the PIC32 Category

AVI Player Project (for the uMMB)

PIC32MX4 uMMB

I have finally cleaned up and posted the code for the Audio and Video player for the PIC32 uMMB board. It is perhaps the shortest code example among the many I have developed for the Mikroe boards, yet so many consideration and so much experimentation went into it.

Far from being completely documented, let’s consider it a start….

More Multimedia Boards

It’s about time for an update on the latest and greatest demo boards for the PIC24 and PIC32.

MikroElektronika has been busy in the last year cranking out new demo boards almost every quarter. While I was happily playing with their very first MultiMedia Board the PIC32MX4 based MMB,

MikroE MMB

they introduced a PIC32MX7 version (adding Ethernet connectivity)

PIC32MX7 MMB

and shortly after that a “microMMB” version with the MX4 processor:

PIC32MX4 uMMB

so small that it barely gives you room for four screws around the display to fix it to a panel.

These boards are great to experiment with the Microchip Application Library (MAL) and in particular with  all things graphics, touch, audio and USB. But they are also ready for being mounted in your embedded control application and to became it’s user interface if not the brain.

I wrote a lot of code for them and I intend to share it and document it gradually in the coming weeks to show you how to get the basic functionality (user interfaces) but also to show you things that many believe would only be possible with much more expensive and complex systems.

You can get a glimpse of it on the new page of the Exploring PIC32  web site dedicated to the Multimedia boards and the Multimedia demo projects.  I am so fond of them, that I have decided to   help MikroElektronika re-sell them and to provide documentation and support on this blog and on my two companion web sites.

Another year, another PIC32 Demo Board

First of all Happy New Year!It’s been a while since the last posting, a lot of things have happened but my enthusiasm for all things 16 and 32-bit in embedded control is greater than ever.Here is quick link to yet another PIC32 little demo board: the CUI32 from the Overtone Labs.CUI boardIt will run StickOS (the PIC32 port) and, following Marku’s blog, you will be able to transform it into a small USB sound card …Have fun exploring!

Solve this!

So I am still investigating the animation capabilities of the PIC32 and the MikroElektronika multimedia board… and having a lot of fun.

Do you remember how to solve the Rubik’s cube? Enjoy!

PIC32 Starter Kits Software v2.0

Software v2.0 for PIC32 Starter Kits has been released, and can be downloaded at (link)

This software replaces all 1.x versions of Starter Kit Software, and is inclusive for all 3 PIC32 Starter Kits.

Animation on the MikroE PIC32MX4 Multimedia Board

I must admit, the MikroElektronika PIC32MX4 Multimedia Board has recently stolen the little that was left of my free time. I found myself toying around until late at night with it, and I have resurrected a number of old projects. The little QVGA display is so attractive, and I could not resist but try to port some of my favorite graphics programs to it.

Basically, if you have seen the MikroE web site,  you have already seen a screenshot of the Mandelbrot project ported to the PIC32MMB. But if you have tried any of the advanced projects I posted on the PIC32 explorer web site, then you already know what I did next.

Graphics animation is more fun!  It is different from basic graphics GUI design and support, because you have to add a real time element to it. To provide fluid motion you have to use double buffering techniques, and if there is 3D, linear algebra needs to be mixed in.

While this is all still very much a big work in progress, I would like to share with you a couple of previews of the kind of things you can do with the PIC32MMB.

This is the basic wireframe 3D cube animation (link)

There are four more videos for you to explore:

A more complex 3D wireframe (link)

More objects animated in 3D (link)

Using the onboard accelerometer to move around objects (link)

And finally a Solid (filled faces) rotating cube with hidden face removal  (link)

Now things are getting real entertaining…  any ideas?

Merry Christmas and Happy Free RTOS

It is Christmas, again, not sure how this happened …

Of all my ambitious plans for  2009 only a few got done, but looking back I am pretty sure somebody must have stolen a couple of months from this years’ calendar. I will be more careful next year, won’t let it happen again.

I have been reading more about RTOSes recently, and specifically FreeRTOS:

freertos-book.GIF

My new year resolution: Learn to use (Free)RTOS to give better structure to my projects and practice the art of programming as the real pros!

Happy Holidays !!!

MikroE MX4 Multimedia Board

It’s out! They did it!

MikroE PIC32MX4 MMB

The new PIC32 multimedia board  from MikroElektronika has been officially announced today!     http://www.mikroe.com/en/tools/pic32mx4-multimedia-board/

MikroE is world reknown for its well designed, documented and fully featured demo boards and development tools for all Microchip microcontroller families. But if you liked their Big Boards…  you are going to love this “small” one.

For less than $150 you get a board that can truly put the PIC32MX460F512 chip to work, allowing you to exercise all its peripherals, including:

  • Drive a TFT QVGA  (320×240) display with a fast 16-bit parallel interface
  • Read Touch screen input or Joystick inputs
  • Play and record sound interfacing to WM8731 16-bit audio codec (including headphone amplified stereo outputs)
  • Access files on SD/MMC cards
  • Access files on USB memory sticks (USB Host)
  • Connect to a PC (USB device) using HID, CDC or MSD classes
  • Connect to a Mouse, Keyboard or printer (USB Host)
  • Connect with a IEEE802.15.4 (MiWi/Zigbee) wireless network
  • Access additional 1Mbyte of serial flash memory
  • Access 1Kbit of serial EEPROM
  • Exercise the Real Time Clock and Calendar with a 32kHz external crystal
  • Interface to an MCP9700 temperature sensor
  • RS232 port selectable (UART1/2)
  • Interface to a 3 axes accelerometer (ADXL345)
  • Use an ICD2/3, Real ICE or even a simple PICKit2/3 to program and debug
  • Further expand the board using standard 100mils spaced side connectors

Also you can take full advantage of the entire set of Microchip Application libraries to create complex applications fast! In fact the board is designed to be compatible with the following Microchip (free of charge) libraries:

  •  Advanced Graphics Libraries
  • USB Framework (Host/Device)
  • MDD File System (FAT16 and FAT32)
  • MiWi / Zigbee
  • 32-bit Audio library
  • Peripheral library (I2C, SPI, UART, RTCC, PWM…)

I want one!… CORRECTION.., I need one!… CORRECTION I need a bunch of them!

Good old printf() (continued)


Continuing on the subject of using printf() as the most basic debugging tool, if you are using the MPLAB SIM software simulator to test portions of your code, you might be aware that the PIC simulator offers the possibility to simulate the UART1 module.

Simply open the Debugger menu, select Settings to open the Simulator Settings dialog box and in the UART1 I/O pane check the “Enable UART1 I/O” checkbox.  This will give you two options:

·         Record anything transmitted by UART1 into a file

·         Send the transmitted data directly to the MPLAB Output window but in a separate pane, next to the Build pane, the Find in Files pane and the Debugger Output panes.

Read the rest of this entry »

Where is my RAM?

I know there are gobbles of RAM in a PIC32 (more than the entire FLASH bank in most other PIC16/18… ) but RAM is one of those things in life you can never have enough of!

Plus, I am an 8-bitter by education, as I have already acknowledged before, and having spent most of my professional life working on microcontrollers with very limited resources, I am very sensitive to waste and waste of RAM in particular.

If you check the memory gauges in MPLAB, even an empty PIC32 program with no function calls and practically no code at all in the main(), will give you a minimum memory usage of 1.5K bytes of RAM. To me that’s huge! I need to know where all this RAM is going and how I can control it should I need it all!

The mystery is easily solved, if you look at the .map file, it shows that 1k byte of that RAM is just the default amount “reserved” for the stack.  As we have seen before (the stack so misunderstood…) the way MPLAB manages the stack memory allocation is a bit tricky. By the way, that memory is not literally allocated, nor the SP register is affected directly, but this number is used at compile time, only once, to check if , after allocating all the global variables and the heap (if there is one), there is still room for the requested amount of stack. So it shows in the memory gauges, but it is not representing by any means the “real” amount of RAM that will be used by your application stack, nor the maximum amount available. In fact the stack will take all the memory left and some… if it needs to.

But where is the other 1/2k byte of RAM gone?

Read the rest of this entry »