Archive for the ‘C’ Category

Bluetooth Serial Port Controller and Wireless UART Cable Replacement Module

Saturday, June 21st, 2008

I have created a DIP module to connect wirelessly via Bluetooth devices using the serial port. It can be a PC to a Bluetooth cellular phone or a microcontroller to a remote robot. Aside from that it can also be used as a remote I/O controller that can be interfaced with a relay board or solid state relays to operate wirelessly. The module’s description, sample projects using it and specifications are found here.

Using Nokia 3310 LCD as Display for PIC Projects

Monday, February 25th, 2008

Parts for older Nokia phones are very cheap and readily available nowadays. I have been toying around Nokia 3310 LCD and used it for some of my projects as display. I have created C routines to use them easily and want to share it to everyone. The files are lcd3310.c and lcd3310.h. The LCD pinout, when looking at the back with the connectors on top starting from left to right, are VDD, CLK, DATA, D/C, CE, GND, VOUT and RESET.

Interrupt Driven Serial Routines with Circular FIFO for PIC Micro

Saturday, December 29th, 2007

This is another routine that I want to share. This is the Interrupt Driven Serial Routines with Circular FIFO for PIC Micro. This routine uses the PIC’s hardware USART. Since this is unbuffered, so I added a software FIFO. The FIFO management is quite lean and fast but required the size of the buffer to be power of 2 (2^x). This is because FIFO roll-over uses bit-wise AND of (buffer_size - 1). This reduces code size due to that no more conditionals to test pointers overflowing the buffer.

GPS Car Speed and Position Logger / Monitor

Thursday, December 27th, 2007

Olimex LPC2148 Board with GPS receiverThe GPS Car Sped and Position Logger/Monitor is a full featured project that is based on NXP/Philips LPC-2148 ARM7 processor. I had to quickly make this for my land trip from Cebu to Bacolod and back last December of 2006.

I used a ready made hardware, the Olimex LPC2148 PCB, that was available at that moment. The board is then wired to a GPS receiver with the 3V supply and the GPS TX pin connected to one of the ARMs serial port.

The software is using a ported FreeRTOS for LPC2148 as its real-time operating system. And incorporates ChanFS file system for log data storage to a FAT16 formatted SD/MMC card.
It also includes code from LPCUSB and has a USB serial port emulation when plugged to the computer to monitor NMEA sentences on the PC. Aside from that, it can be booted up as a USB mass storage device to retrieve the logs without removing the SD/MMC card from the board’s slot.

The code can be compiled using WinArm GCC.

Tiny Threads - Tiny Multitasking Threads for Microcontrollers

Thursday, December 27th, 2007

For the efficiency and performance conscious C programmers, here is my tiny cooperative multitasking engine.

This was made for PIC16F micros that has a very small available flash for code and ram/memory. But this can be used also for other processors because I tried to make it ANSI compliant. For the PIC16F processor, this uses only 1 byte RAM needed per thread and compiles to a very small overhead context switching.