Restore or Upgrade Mindsensor NXTCam Firmware

PDF Creator    Send article as PDF   
After receiving my NXTCam a couple of days ago, I experimented with it for an hour or so initially before turning in for the night. The next morning, I found my NXTCam‘s Firmware didn’t like being woken from it’s slumber! I found Deepak Patil of Mindsensors extremely helpful in getting me pointed in the right direction initially when I had issues with my NXTCam v3.0. My panicked emails were responded too very efficiently despite a time zone difference of 12+ hours.

If when using NXTCamView you can’t connect to the Mindsensor NXTCam, and you receive a “Search Error: The operation has timed out.”. But the NXTCam shows up in the NXTCamView Comport list and the MS Windows Device manager, then your NXTCam‘s Firmware has most probably become corrupted.

The NXTCam has three processors and a CCD within the sensor unit. The PIC16F886 and AVR Mega 8 are the important processors which interest us. Both the PIC16F886 and AVR Mega 8 have a different Firmware each, with both having the ability to be updated. Both these pieces of Firmware can also fail for no good reason that I can determine.


NXTCam Architecture
NXTCam Architecture

The I2C communication with Host I2C controller (LEGO NXT) is handled by PIC16F886. This processor also communicates with AVR processor to send commands and receive the responses via an internal serial bus.

The ATmega 8 processor runs the image tracking algorithm. In the default firmware, the colour tracking mode is invoked by an ‘Enable Tracking’ command from the PIC processor. In this mode, each scan line from the image is brought into the processor memory, the line is processed and then discarded to get next scan line. As a result the AVR processor is continuously send tracking data to the PIC processor, or until a ‘Stop Tracking’ command is sent. This same communication happens with NXTCamView, or other USB host program as well.

There is one Default firmware available in pre-compiled hex form, which is factory installed on your NXTCam-v3 when you purchase it. There is also a selection of Custom Firmware available. Source code of the firmware is available at  NXTCam Project. You can create your own customised AVR firmware hex file using this source code and AVR programming tools.

Required Before Restore
Ensure that you have all the required Firmware files:

NXTCam Firmware Code Repositories:
  svn co nxtcam  

Start by Restoring the AVR firmware via PIC processor:

First change NXTCam PIC firmware with file nxtcam_AVRbootstrap.hex. This will take about 8 minutes for upgrade / repair.

Run the Firmware Upgrader application

Firmware Upgrader

The Firmware Upgrader is designed to run on a MS-Windows XP or Vista computer.

  1. Place the program and its configuration file and device firmware in any folder on your computer.
  2. Connect your NXT directly to your PC on USB port. (Do not use USB hub between PC and NXT. Do not connect your device to NXT yet).
  3. Exit all other softwares that could interfere with NXT connection. (Softwares such as NXT-G, BricxCC, RobotC do connect to NXT).
  4. Power OFF and Power ON NXT to ensure fresh USB connection.
  5. Browse to the folder and double-click the application ‘firmwareupgrader‘.

Select the Device type

From the ‘Device’ menu, select menu item ‘Select Device type …’ and choose NXTCam.

firmware upgrader select device type

Open firmware hex file

From ‘Device’ menu, select menu item ‘Open Firmware hex file …’, browse to the hex file, and open it.

Firmware Upgrader - select file

Upgrade the device

Now from ‘Device’ menu, select menu item ‘Upgrade Device …’ The program will look for the device for about 10 seconds, during this time, connect the device to your NXT on Sensor Port 1.

(If your device is already connected to Sensor Port 1, unplug it and plug it back in while the program is looking for the device.)

firmware upgrader attach device

Wait for upgrade process to complete

The progress bar will indicate remaining time required to finish this process. Do not disconnect the NXT or your device until the upgrade finishes.

upgrade in progress

Disconnect the device

It now has the new firmware that you had in the nxtcam_AVRbootstrap.hex file.

upgrade complete

When the bootloader shows a dialog indicating upgrade has finished, Ignore the device checksum errors.

Then –
  • Wait about 45 seconds, Disconnect NXTCam from NXT.
  • Exit Firmware Upgrader.
  • Power off NXT.
  • Connect NXTCam to NXT (while NXT is powered off).
  • Power ON NXT and wait. (at this point the bootstrap program will re-image the firmware – it takes about 30 seconds).
  • Wait for 30 seconds or longer, and then power off NXT.
Now restore the PIC firmware:

Using Firmware upgrader to upgrade the PIC Firmware in the NXTCam. Follow the steps above with file: nxtcam_def.hex instead this time. It should take about 8 minutes for this step.

Upon finishing –

  • Power off NXT and
  • Disconnect NXTCam from NXT.
  • At this stage your NXTCam should have both the new firmwares installed.
Check / Restore your NXTCam settings:
  • Attach NXTCam to Port 1 of your NXT and run the program nxtcam-settings.rxe.
  • Use Gray Arrow buttons to increment or decrement the settings value for your previous value and press Orange button twice  to commit that value to NXTCam.


Next time you have issues connecting to your NXTCam via USB, first try running nxtcam-settings.rxe and restet the settings value. In my case with the standard firmware installed it’s ’53’. I’ve noticed swapping from NXC to RobotC firmware on my NXT will sometimes cause this setting to change.

I trust you found this guide useful. All the information I’ve used is available on the Mindsensors Website, but I found it hard to track down and figure out initially. Hence the reason for this How-To-Guide! I still can’t locate ‘nxtcam-settings.rxe‘ on the Mindsensors Website, but you can download it from here: nxtcam-settings.rxe

Previous Post

LEGO Mindstorms Cable Tester

I needed a LEGO Mindstorms Cable Checker to allow me to Verify my Connector Cables for connectivity or faults.  A tester is particularly useful for when you are crimping your ... Read more

Next Post

A Shinning Light for the NXTCam Camera

I've been experimenting with my new Mindsensor NXTCam. As most people are aware of the inherent issues associated with optical sensing, mainly due to changes in lighting level, can be ... Read more

Short URL:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do NOT follow this link or you will be banned from the site!