Sunday, 9 January 2011

Baud to tears

I was hoping to get the complete milestag gun assembled this last week. But before I could finish it I needed to program the ISD1790 sample playback chip which is present on the milestag PCB.

The ISD1790 has A/D and D/A converters, and FLASH memory to allow it to record and playback up to 90s of audio as 8kHz mono samples.

The IC also has an SPI interface to allow microprocessor control.

The milestag RevH core software has a mode to allow this IC to record audio played through a PCs line out socket. All that is required are an RS232 lead to the milestag PCB and an audio connection from the PC to the PCB.

This caused me no end of problems. I constructed RS232 and audio leads as specified in the RevH manual.

During the record phase, the ISD1790 board routes the audio input pin to the audio output pin so you can check the sample quality through the target speaker.

Putting the RevH mode into sound record mode did this, but the PC sound recorder software supplied did not force the sounds to record on the RevH board.

I checked all connections to no avail.

I then got back to basics and checked the PIC oscillator frequency with a scope. The PIC software is written to work at a particular frequency, and the RS232 baud rate it uses to communicate with the PC is a function of this frequency.

The scope showed that the clock was not running at all. I read the PIC memory with my ICD2 and this showed that I had set the PIC clock config byte incorrectly. This meant that the PIC was being clocked at 4MHz instead of 16MHz.

The result of this is that the PIC was expecting data from the PC at 2400 baud instead of the 9600 baud the PC uses.

I reprogrammed the PIC with the correct oscillator config and the sounds recorded successfully.

During all the plugging and unplugging I managed to damage the LCD display so as as soon as I have a replacement I will complete the build

No comments: