Archive for December, 2006

December 19th 2006

EFSL for the ARM LPC2148

Found a LPC2138 port of the Embedded Filesystems Library. Took this stuff and made this working on my LPC2148.

Now i can access an SD-Card attached to the LPC2148. Currently the FAT filesystem is supported. The sample pgramm includes an minimal serial line shell which supports file reading and directoy listings.

MMC/SD Card Filesystem Test (P:LPC2148 L:EFSL)
CARD init...spiInit for SSP/SPI1
Card is initialising.
CSD: 00 26 00 32 5F 59 83 C8 BE FB CF FF 92 40 40 D7
Drive Size is 1015808000 Bytes (1984000 Sectors)
Init done...
Press Command: d r a 
You pressed : d
Directory of 'root':
TEST01      ( 6 bytes )
TEST02      ( 6 bytes )
TEST03      ( 6 bytes )
TEST04      ( 6 bytes )
TEST05      ( 6 bytes )
TEST06      ( 6 bytes )
TEST09      ( 6 bytes )
TEST10      ( 6 bytes )
LOGDAT9 TXT ( 833 bytes )
DUMMY   LOG ( 2754 bytes )

download source

No Comments yet »

December 18th 2006

ARM LPC2148 and Linux

Just got my ARM LPC2148 Dev Board from Olimex

I put together a small overview how to get things working using a linux host system.

Toolchain

  • GNU Compiler Toolchain
  • Serial Programmer
  • Sample Code

  • Crt0
  • Linkerscript
  • Init Routine
  • Simple IO Test
  • SIO Debug Console
  • GNU Compiler Toolchain

    I use a standard arm GNU toolchain. Actuallay found this binary download from mikrocontroller.net. But also my GBA Toolchain worked and produced good binaries. So a Gentoo ARM Crossdev should to the work. Think that the LPC is not too picky about that.

    Serial Programmer

    I tried lpc21isp but it didn’t work for me. So i ended up using lpc2k_pgm. It has little gui and where you can setup all needed configs. I use iHex format to upload to the dev board, where i had best results using quite slow sio speed like 9600bps. You have to enable BSL on the LPC2148 for ICSP. On my LPC the switch is called ‘ICSP1′ which needs to be set into ON position.

    Crt0

    Nothing special about that. Took it from similar LPC based projects.Just setup stack sizes and default IRQ vectors. Worked out of the box.

    Linkerscript

    Tooks this from a other LPC project. The script specifies the memory layout of the target system and defines the sections for the binary output.

    Init Routine

    Code found in startup.c does the PLL init. The LPC2148 has 12 Mhz internal crystal but can run up to 60Mhz when setting the PLL. Also the default IRQ Handlers are defined here.

    Simple IO Test

    I used the on-board leds for a simple IO test.

    
    int main(void)
    {
        unsigned int i;
        Initialize();
        ConsoleInit(60000000 / (16 * BAUD_RATE));
        puts("Init done\n");
        IODIR0 |= 1 < < 10;          // P0.10 is an output
        IODIR0 |= 1 << 11;          // P0.10 is an output
        IOSET0 = 1 << 10;           //LED off
        IOSET0 = 1 << 11;           //LED off
    
        while (1) {
            for (i = 0; i < 1000000; i++);
            IOSET0 = 1 << 10;       //LED off
            IOCLR0 = 1 << 11;       //LED on
            puts("led1: off  led2: on\n");
            for (i = 0; i < 1000000; i++);
            IOCLR0 = 1 << 10;       //LED on
            IOSET0 = 1 << 11;       //LED off
            puts("led1: on   led2: off\n");
        }
    }
    

    SIO Debug Console

    Addes a little module that uses one of the two serial line for debugging output. I use the same serial port as for for the ICSP, so after the flashing lpc2k_gpm will display the output directly without any setup changes.

    pic1 pic2 pic3

    download source

    1 Comment »

    December 13th 2006

    Gnuboy AALib

    This is really usefull, isn’t it. Made a video driver for gnuboy based on aalib. The sound it actually done by sdl lib. But i don’t care about sound to much because this thingy is meant to be played via telnet. So hook up the aagnuboy binary into xinted and have fun.

    service aagnuboy
    {
        disable         = no
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        log_on_failure += USERID
        port            = 1989
        server          = /usr/local/bin/aagnuboy 
        server_args     = /usr/local/games/roms/demo.gb 
        log_type        = SYSLOG daemon info
    }
    
    

    pic1

    download gnuboy

    No Comments yet »

    December 13th 2006

    Return of the SNES

    Updated my old SNES demo a little so that it runs on real hardware. Was able to get my handy on a half broken Super Wild Card. So i finally i fixed the rom headers and now the little demo runs on a real snes. Nice.

    Snes Snes

    Snes Snes

    Source

    No Comments yet »

    December 13th 2006

    PSP Futurecomposer Player

    Made a Futurecomposer player to the PSP. This version is hacked together from the xmms-fc and the fcplay sources. First i did x86 version using alsa interface. Later ported this over to the psp using the native audio interface. Memory footprint is quite ok, despite the fact that the old FC engine is written in c++ so that the whole stuff has to be linked against libstdc++ which makes the player kind of bloated.

    pic1

    download fcplay

    No Comments yet »

    December 1st 2006

    Sidplay

    Ported the original sidplay to the PSP. Now i use the native pspsdk audio libs so SDL is not needed anymore. This reduces the footprint by 200 Kb.

    download sidplay

    No Comments yet »