The travails of fixing an old design




Recently I had the opportunity to fix a design I did way back in 2005.   It turned out to be a bit more trouble than I anticipated.  In the past I have talked about the need for good record-keeping and how that gets harder  and harder to do as the technology in question gets older and older.  Fortunately for me we had been conscientious enough to retain enough of our old-technology to allow me to fix the problem . . . . barely.

[Read more…]

Arduino Compatible Motor Controller


We’re about to put into production an Arduino compatible robot controller.  The design carries two microcontrollers.  The first is Atmel’s ATmega328.  This controller is loaded with the Arduino open-source bootloader.  That means you can interface to it, and load programs, like any other Arduino.  The second microcontroller is a Microchip PIC16F1829.  It’s loaded with an open-source C program that matches our BM011 dual motor quad servo controller.  We’re calling the product the Firstbot, since it’s a great platform to develop your first robot on.

Initially I don’t think we’ll sell it with the connectors installed (to keep the cost down).  We might have an add-on packet that includes 0.1” male and female headers.  The male headers are shown in the image above.  The design has 2 DC motor controllers that can carry 1A continuous and 5A peak (5-28V).  There are 4 servo input channels allowing you to connect it to an RC receiver.  There are also 4 servo output channels, allowing you to drive 4 RC servos.  The motor control firmware is open-source and written using Microchip’s  XC8 compiler.  There’s a small connector for a 0.05” spacing header that can be used with an adapter board to connect a PICKit3 to the board, and customize the motor controller.

Single unit pricing will be ballpark $30.   Available in the next few weeks.

Arduino Compatible Robot Controller 2


We’re getting pretty close to finishing up the Arduino compatible robot controller design.  We’ve completed the design, re-design, prototype, re-prototype, assembly, and initial testing (those “re-’s” are not always required).

[Read more…]

Dual DC Motor Controller with Quad Servo Controls


I’ve been working on this design on and off for the last couple of months.  The idea came about when I was trying to build a robot that needed to read servo pulses, write servo pulses, and control two motors.  I tried using an Arduino, but it really wasn’t up to it.

[Read more…]

How to Detect Debug Mode in a PIC Micro



I’ve been posting about my progress in designing a dual motor controller that also reads and outputs RC servo pulses.  For that design I used a PIC16F1829 from Microchip.  It’s a pretty cool little part with lots of features, but also a low pin count.  I was able to get all of the functionality squeezed into my design.  But I did run short of pins and had to multiplex the debugger/programmer connections (PGD and PGC lines).

[Read more…]

Robot Wheel Design


Robot wheel controller and mechanical progression.

I’ve spent a lot of my spare lab time messing around with a robot wheel mechanical concept, and an electronic design that controls a pair of DC motors and 4 RC servos.  Here’s an update.

[Read more…]

SHA-512 encryption–the easy way

Over the last couple of months, we have been working a project for a new client.  It is a custom-user interface that requires encryption.  We have done encryption before for the financial industry, implementing 3DES with DUKPT key management.  We’ve also done MD5 hash algorithms and AES.  In all of these cases  we’ve had to “roll our own” code.  We found the relevant standards and implemented the code.  It was a time consuming and mind-numbing process.  This is doubly so for the 1DES and 3DES code, when we accomplished this task by writing it in assembly!  However, over the past five years, most microcontroller suppliers have really filled out their offerings with encryption.  Over the past week, this has really come in handy.

The new design is defined using the SHA-2 algorithm.  Specifically the SHA-512 implementation – the big daddy.   After checking out the specification, and getting a mild case of code phobia, I decided to see if there was some help on the web.  We are using a 24FJ-series microcontroller from Microchip.  I did a quick spin through the Microchip website looking for encryption ap-notes or libraries.  Unfortunately, their published libraries only covered algorithms through SHA-1.  Things were looking grim – we were going to have to code up the SHA-2 from scratch.  As a last gasp, I contacted Microchip directly through their normal tech support channel and asked if there was a SHA-512 ap-note I had not seen.  They did NOT; however, they did have some beta code for an ap-note/library they are working on and they provided it to me.

I tried the Microchip SHA-512 algorithm out and spent about 10 hours with it, making sure everything worked with standard test vectors and with the test vectors from the back-end of the system we are interfacing to.  Success!  I was able to get this chunk of the design roughed in in about 20% of the time I was budgeting.  Microchip really saved my bacon.  I am really impressed with Microchip and their “above and beyond” approach.  More on this project later.

Arduino Clock

bm005 real time clock

An Arduino clock and calendar is easy to build using the BM005 clock module.  The heart of the module is Microchip’s MCP79400 I2C RTCC.  The MCP79400 has a number of cool features, including leap year compensation, battery back-up (with an external battery), time/date storage on power failure, 12 or 24 hour format, and even some extra RAM if you need it.  Our BM005 puts it all in an easy to use module for a retail price of $12 (BM005 datasheet).

[Read more…]

Microchip PIC16F1829 Serial Communication


I’m writing code for a Microchip PIC16F1829 and thought I’d share the serial communication routine.  I’ve completed the schematic capture and PCB layout for the servo motor controller design.  But it’s a good idea to get some code written before moving forward with the PCB prototype production.  I’ve written a good chunk of the code for this design.  When the design is complete we’ll open source the files and place them on our web site (including the firmware for the microcontroller).

[Read more…]

MPLAB X Microchip’s Newest IDE


MPLAB X is Microchip’s newest integrated development environment (IDE).  It’s a follow-on from the venerable MPLAB IDE that is somewhere near version 8.8 these days, and probably won’t ever get to version 9.

[Read more…]