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 New Year

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 »

Changing habits… and dreaming a bit

It has been a hot month of August as I visited back home in Italy and even here in Germany, I mean… everything is relative!

Returning home after a few days off is typically a moment of (small) revelations. Things that had gone unnoticed, in the day to day routine, can stand out when the background changes. Yesterday morning for example, the satellite TV receiver was looking at me sad and lonely from the back of the living room!  It had been months since I had turned it on last.  Actually I just realized that the only user of the TV screen in my house for the last several months has been my 20 months old son. Not much of a user either, as he has only been watching Bamby II (in 15 minutes installments) before going to bed each night …

What happened to the news? I don’t trust the TV anymore… I check things on the internet.

What happened to the occasional movies? I hate the frequent commercial interruptions (even if less frequent here than in the US) so I mostly watch them off DVDs (on my wife Mac mostly) or streaming directly from the “media server” ( a Linux machine by the way…)

Speaking of PCs, I turned my attention to the “desktop” which is a Windows XP machine we keep in the office room. That one has been off for several months now as well. Last I remember using it was because of a printing job (we are not printing that much either… apparently, good for the trees). The cheap inkjet printer I bought last year (for Euro 59) is not natively supported by my Linux distro (Ubuntu), so I attached it to the XP machine making it probably the last and only useful application for it!?

All the action is now on the Linux media server and my (and my wife’s) laptop(s). While my wife is already on OS X, which covers pretty much all her needs, I am still running on a (company issue) crancky IBM laptop under Windows XP.

Could that last installation of Windows on my lap be replaced by something else one of these days ?

There are three critical systems I use every day on that laptop: Office, Outlook and MPLAB.

The copy of Microsoft Office I use is so old and basic that I am pretty sure it could be easily and compatibly replaced by OpenOffice on Linux or similar package on the Mac.

The version of Outlook I am using is very old as well, and it was not a long time ago when we were using a completely different system. I am not sure why we did the switch to MSFT as I did not notice any advantage in the transition, at least there was none from a user perspective…

But it is truly MPLAB that seems to be last bastion of Windowsness…

Now I heard rumors that that might be changing… well’ see… perhaps next year, I will be writing a similar post and realize that I am now completely TV and Windows free and working on my shiny brand new and ultra-thin Mac Air !?

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 »

Olimex PIC-P32MX board

And the PIC32 demo boards saga cannot be complete until we mention the Olimex PIC-P32MX

Olimex PIC32MX

This board is interesting and unique for a couple of good reasons:

  • It offers a traditional serial port instead of the USB interface
  • It ’s the most convenient for a quick wire wrap job
  • Offers both ICD and JTAG connectors
  • It’s most probably the cheapest of them all at Euro 19.95!

A Great New Board from mikroElektronika

The guys at mikroElektronika are very well known in the embedded and educational world for their large but inexpensive and well laid out boards for all PIC products. So I had been waiting quite anxiously for their first PIC32 specific board, and here it is!

The LV32MX Development Board

LV32MX

Read the rest of this entry »

A new PIC32 Stick

PIC32 Stick

There is a new third party tool available for the PIC32 … it’s a stick!

I love sticks because they are easy to handle, expand, connect. They fit on good old breadboards and wire wrap (perforated) boards.

The guys at eFlightWorks have done a good job of fitting a PIC32MX440F256 in a 56 pin DIL package, exposing the USB port and providing all the basic necessities.

The promise is to port a simple BASIC interpreter and OS (known as StickOS) to the PIC32 so that code development, programming and debugging will be possible without need to use any external (in circuit) debugger/programmer …

I am waiting anxiously for the first release to give it a try…  I will let you know…