Thursday, June 9, 2011

NTSC demystified - Cheats - Part 6

Throughout this series of articles we've seen a number of "cheats" or non-standard signals which simplify NTSC signal generation. This post summarizes them.

NTSC demystified - Implementation - Part 5

Now that we understand how NTSC color coding works and the math behind it, it's time to think of ways to implement color coding. Knowing the math helps because that knowledge equips us to abuse the system and implement color using simpler/cheaper hardware.

Saturday, May 21, 2011

WAV Player with LPC1768 and SD card

After porting the SD card low-level IO functions that my project team had written for the AVR Atmega 8-bit series about a year ago, integration with elm-chan's FAT FS was seamless. Keeping the connections suggested by Mike, the SD card posed no difficulty at all.

Playing a WAV file with a microcontroller is a "hello world" equivalent when interfacing with the SD card. For this, the motor control PWM peripheral looked ideal since I needed the main PWM peripheral for something else. An RC low pass filter of 330 ohm and 0.1uF is good enough to filter out the PWM frequency and its harmonics while leaving the audio signal intact.

Friday, May 20, 2011

Interfacing with SD card gotcha

Elm-ChaN's tech notes on interfacing with SD card is fantastic. There are, however, some things left unsaid. Today, my colleague Thejasvi and I discovered two aspects not explicit in that tutorial.

1. The way /CS signal should be handled.

Before sending a command, make /CS low. Get the response, data packets ( if any ). Now, it is essential to make /CS high before sending the next command.

2. After one command is complete. That is to say, a command is sent and a response is got (mostly R1 response) , do NOT make /CS high. The card will go out of sync and wont accept new commands properly. After the R1 response is got, send atleast one dummy byte(0xFF) and then make /CS high. Now it is ready to accept new commands. This is probably because the card is completely inactive if no data is transmitted to it as no clock signal goes to it. My conjecture is that it needs a few clocks to resynchronize after a command-response before it can accept a new command. Thus the dummy byte after the R1 response.

Thursday, April 28, 2011

NTSC demystified - Math - Part 4

This post targets largely electrical engineers and involves a bit of math and basics of analog communication. A more formal treatment of the NTSC color signal along with results, which will assist digital NTSC color signal generation is presented.

Wednesday, April 27, 2011

NTSC demystified - Nuances and Numbers - Part 3

Ever since I understood how NTSC color worked, I've had a nagging question. How does the TV separate color info (color sub-carier) from the luminance information. If the same color was maintained all throughout the line, then the color carrier can be removed away by narrow band-reject filtering. But when the color changes (phase changes) , then how does the TV distinguish color from luminance which is also possibly changing ?

DSP Library for LPC17xx

NXP has most kindly provided a free assembly coded DSP library for its users. I needed to extract the fundamental frequency of an audio signal and with this library, the job got over in 5 minutes.

Wednesday, April 20, 2011

NTSC demystified - Color Encoding - Part 2

NTSC composite video is a compatible standard. This means that video signal works with older B&W TV Sets as well. So, we're looking to understand how color information is added to the B&W NTSC signal in such a way that Color TV sets can decode the color information while older B&W TV sets ignore the color information. Developing such a signal must have been a formidable task indeed !

Tuesday, April 19, 2011

NTSC demystified - B&W Video and Sync - Part 1

NTSC progressive scanning mode and simpler sync methods are not well documented and this issue is addressed here. Producing video signals by going to lowest hardware level is fun and satisfying. With the number of very capable digital controllers available to hobbyists today, it has become possible to generate analog video signals entirely in software. With the techniques and sync patterns presented here, generating "software video" becomes a much easier task.

Monday, March 28, 2011

LPC1768 ADC has too many glitches

The on-chip ADC in the Atmega lineup was so easy to use compared to the one on LPC1768. Last time I had tried, the Atmega ADC didn't need much filtering to give reasonable results. But the ADC module on LPC1768 seems unusable without filtering.

Thursday, March 10, 2011

UART to USB converter using LPC1768 and AVR 8-bit UART library

While working on a project on the Atmega8 for school, the FT232 chip being used as a UART - USB converter failed. Well, actually its the board that failed, or rather broke...

Saturday, February 19, 2011

LPC17xx Virtual COM port - A USB CDC Class device library

With physical COM ports non-existent in laptops and fast disappearing on desktops, its a matter of immense convenience to embedded programmers if a chip has the USB interface.

Friday, January 14, 2011

Code Sourcery g++ Lite and Programmer's Notepad for LPC1768 development

Eclipse is a fantastic IDE but some may prefer the light weight Programmer's Notepad. This post will show you how easy development for LPC1768 on a Windows box using CodeSourcery g++ Lite and Programmers notepad is.

Wednesday, January 12, 2011

Interrupts, Software Interrupts and Interrupt Priority in LPC1768

The cortex-m3 core which the LPC1768 uses has an extremely flexible interrupt controller called the NVIC (Nested Vectored Interrupt Controller). The NVIC has several distinguishing features.