Archive for the PIC24 Category

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 !!!


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 »

Searching for a Pin in a Haystack

There is one problem I have with the current style used in the PIC24 and PIC32 datasheets, it has to do with the way the pin out of the device is presented. Since so many functions are multiplexed on each pin, I find myself constantly checking for potential conflicts when choosing carefully my GP I/Os. The pin-out table is designed to list alphabetically all the individual options and determine the pin number, but then how do you cross check for other functions with the same number?

As I did before for the PIC24, I have created a convenient Excel spreadsheet and filled it with the PIC32MX3xx pinout table info: PIC32MX3xx pinout

Now you can sort the pins by name, by pin number (in different packages) or by group/peripheral.

As an added bonus it was easy to include the information about the pin usage by the Explore16 board and the various PICTail boards available (including the AV16/32 of course).

I hope you’ll find it useful…

P.S. Should you find any error or omission, please make sure to report it to me…

Inexplicably Working Errata

A few days ago, I received an email from a reader who reported a new errata on page 123 (in the “Learning to fly the PIC24″ book) in the write() function, an example of redirecting the “stdout” output stream.

The function receives a pointer to a buffer containing characters that need to be forwarded to the output device of choice and a counter. A loop is performed to print sequentially the required number of characters, but (here is the bug) I apparently omitted to increment the buffer pointer.  To the reader’s greatest surprise the code example seems to work anyway! How is this possible?

Read the rest of this entry »

Back online, Excuses and the Blues Brothers

It has been almost three full months since my last posting and you might have been wondering what happened … I have only a few excuses, but good ones:

  1. I moved back to the old continent, I am now writing this from Munich, Germany
  2. I changed job (a bit), while still working for Microchip, I am now responsible for the marketing of 32-bit microcontrollers in Europe, Middle East and Africa. This of course requires quite a bit of traveling.
  3. But perhaps the most important one is my new “project”, my son Luca, who is now 10 months old and absorbing ALL that is left of my wake time.

In this last few months I have received tons of email, (I love emails from my readers) and tried to respond to most of them. Some of you have been reporting about typos in the books and/or issues with new versions of the compilers and libraries. Others have brought up interesting ideas and questions that I plan on using in the future postings. Slowly, I will try to cover all the backlog and get back live.

Stay tuned!

P.S.: For those among you who are old enough to remember the Blues Brothers movie, here is Jake’s (Jim Belushi) original list of excuses:

  1. I ran outta gas.
  2. I had a flat tire.
  3. I didn’t have enough money for cab fare.
  4. My tux didn’t come back from the cleaners.
  5. An old friend came in from outta town.
  6. Someone stole my car.
  7. There was an earthquake,
  8. … a terrible flood,
  9. …locust’s.
  10. It wasn’t my fault!!

|