micro adventures

February 28, 2010

PCM-4823L Single board computer Linux embedding

Filed under: SBC — Tags: , , , — Piotr @ 8:13 pm

A year ago I got a half-sized biscuit single board computer PCM-4823L from http://www.advantech.com. Now I finally found some time to tackle with embedding a Linux distribution into this PC.

I decided to go for DSL.

Installation to a Compact Flash (as root)

1. Got an empty CF, and create 3 partitions ext2/3: 100MB (> 50MB), 100MB, and swap 64-128MB

2. Install grub boot loader

2.1 Mount first partition

2.2 Change to the mounted CF  (eg: cd /mnt/cf)

2.3 Install grub:

grub-install  --no-floppy  --root-directory=.   /dev/<rootdevice>

Replace <rootdevice> with the corresponding file which represents your USB storage – my (/dev/sde ) do not use any number it should be MBR

3. Copy the DSL image content to CF

mount [/path_to/]current.iso /mnt/loop/ -o loop
cp -vR /mnt/loop/* /mnt/cf/

4. Create in ./boot/grub/menu.lst new file: menu.lst with following content:

timeout 10
default 0
title           DSL
root            (hd0,0)
kernel          /boot/isolinux/linux24 root=/dev/hda1 3 vga=normal noacpi noapm noscsi nopcmcia nousb noapm nomce noddc nofirewire frugal 2 dma lang=de restore=hda2 home=hda2 opt=hda2 host=DSL  dsl mydsl=hda2
initrd          /boot/isolinux/minirt24.gz

title           DSL-test
root            (hd0,0)
kernel          /boot/isolinux/linux24 root=/dev/hda1 ro lang=de frugal
initrd          /boot/isolinux/minirt24.gz

boot

5. Check the file /mnt/cf/boot/grub/device.map and update drive mapping acordingly e.g.

(hd0)    /dev/hda
(hd1)    /dev/hdb
(hd2)    /dev/hdc
(hd3)    /dev/hde

6. Remaster  DSL:

6.1 Extract KNOPPIX image from cd iso image

6.2 Extract the KNOPPIX file system (cloop rpm will be needed):

$ extract_compressed_fs /media/cdrom/KNOPPIX/KNOPPIX > uncompressed-image
$ mkdir mnt1
$ sudo mount -o loop uncompressed-image mnt1
$ cp -a mnt1 extracted
$ rmdir extracted/.rr_moved
$ sudo umount mnt1
$ cd extracted

6.3 Customize DSL …

6.4 Compress file system back to the KNOPPIX

$ cd ..
$ mkisofs -hide-rr-moved -allow-leading-dots -R -l -V "KNOPPIX ISO9660" -v -allow-multidot $SAND_BOX | create_compressed_fs - 65536 > KNOPPIX2

Useful links:

  1. Frugal DSL Installation
  2. Hacking DSL

February 26, 2010

PSone Thrustmaster LCD to RGB got a picture!

Filed under: LCD — Piotr @ 9:31 pm

I was looking for a small LCD for my DTV and bought  on ebay a dead PSone with working Thrustmaster LCD for a quite encouraging prise of 2€. Unfortunately this LCD does not provide composite video input. Anyway I wanted to connect it to a video signal just to check if it worked.

It works, hereafter some information for those who wants to reuse this to connect to RGB Vidoe signal.

Pinout of the Sony Multi Video AV interface:

Pin Name Description
1 GND Ground
2 RT Right Audio
3 GND Ground
4 LT Left Audio
5 Y S-Video Y
6 SYNC Composite Sync
7 C S-Video C
8 VGND Video Ground
9 B Blue
10 +5V +5 VDC
11 R Red
12 G Green

Pinout of SCART interface:

scart-pinout2

Pin Name Description Signal Level Impedance
1 AOR Audio Out Right 0.5 V rms <1k ohm
2 AIR Audio In Right 0.5 V rms >10k ohm
3 AOL Audio Out Left + Mono 0.5 V rms <1k ohm
4 AGND Audio Ground
5 B GND RGB Blue Ground
6 AIL Audio In Left + Mono 0.5 V rms >10k ohm
7 B RGB Blue In 0.7 V 75 ohm
8 SWTCH Audio/RGB switch / 16:9 0-2 V=TV, 5-8 V=WideScreen, 9.5-12 V=AV Mode >10 kohm
9 G GND RGB Green Ground
10 CLKOUT Data 2: Clockpulse Out (Unavailable ??)
11 G RGB Green In 0.7 V 75 ohm
12 DATA Data 1: Data Out (Unavailable ??)
13 R GND RGB Red Ground
14 DATAGND Data Ground
15 R RGB Red In / Chrominance 0.7 V (Chrom.: 0.3 V burst) 75 ohm
16 BLNK Blanking Signal 1-3 V=RGB, 0-0.4 V=Composite 75 ohm
17 VGND Composite Video Ground
18 BLNKGND Blanking Signal Ground
19 VOUT Composite Video Out 1 V 75 ohm
20 VIN Composite Video In / Luminance 1 V 75 ohm
21 SHIELD Ground/Shield (Chassis)

The connection between LCD and SCART as a quick and dirty list:

LCD/PSone Multi AV  <=> SCART
 1 GND              <=> GND 21, 5, 9, 13, 18
 2 Right Audio      <=> AIR 2
 4 Left Audio       <=> AIL 6
 6 Sync             <=> VIN 20
 9 B                <=> B 7
11 R                <=> R 15
12 G                <=> G 9

VGA connection (stollen from http://forums.bit-tech.net/showthread.php?t=103008

Cable

January 17, 2010

Update: Audio Spectrum Analyser for Ping-Pong

Filed under: PONG Board — Piotr @ 10:36 pm

Another update from today.

By adding an oscilloscope mode I noticed that PD2 is connected to potentiometer  (as a pull-up Vcc).  It was necessary to have an independent from the potentiometers button. Now  PD3 (INT1) is used to go through different display modes.

In the oscilloscope mode you can amend TimeScale with the left potentiometer.

downloadbutton

Download AVR 4 Studio / WinAVR files from here

A video come later.

January 16, 2010

Update: Audio Spectrum Analyser for Ping-Pong

Filed under: PONG Board — Piotr @ 11:12 pm

Hi there,

This weekend I’ve reviewed the sampling procedure used in the spectrum analyser and increased the sampling frequency, by moving it from interrupt procedure into the main loop. Furthermore I added some display modes of analyser spectrum. Display mode can be changed by pressing PD2 / INT0. Button is a shortcut to GND. On Pong Board it is the coin insertion “switch”.

downloadbutton

Download AVR 4 Studio / WinAVR files from here

January 10, 2010

Audio Spectrum Analyser for Ping-Pong Board from Conrad.de

Filed under: PONG Board — Tags: , , , — Piotr @ 8:42 pm

Audio spectrum analyser driven by Atmega AVR seems to be a one of the favourite topics. Pong board gives us a nice display with 12 column ten LEDs each. This makes this display a perfect one for a spectrum analyser.  I will not elaborate here any mathematics part of a spectrum analysis. What you need is a discrete Fourier transformation (DFT) or better to say a respective fast algorithm so called FFT. Luckily FFT (its fixed point version) was implemented for Atmega AVR by ChaN in 2005. See for details http://elm-chan.org/works/akilcd/report_e.html. I reused his code and by adding some neccessary lines I made out of the Pong board an audio spectrum analyser.

The audio signal  is connected to the Right Potentiometer via  100µF capacitor. A really bad solution :(

The results are not bad – see two examples.

Remark: in the second video I used some commercial music. It has been flatten by my monitor speakers and microphone from digi cam but we know youtube . I hope they will not remove this clip or get rid of the soundtrack.

I’m quite satisfy with so simple implementation and a pretty good result. I would add here kind of op-amp as a input filter. Max239 from ChaN’s projekt seems to be a good idea. From the application point of view I would look closer to the size of the buffer used for data samples. A decrease to 32 and getting 16 results fits much better to our small display.  And more display effects would make this more interesting.

The sounds at the begining part is not the best, I will make the video once again if someone will ask for :)

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=-YsMRiT4e94

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=Dwob_27O8SM

Here another video, from local host (commercial audio and youtube policy make me crazy)

By the way:

In the first video I used two free programs from http://www.marchandelec.com: very simple function generator and third octave real time spectrum analyser. It is a pity there is nothing similar under linux. The only one I found it was python based tone.py: http://aa6e.net/software/tone/index.html. It does not work for me in my new Pulse Audio environment (padsp does not solve anything). Another peace of software, a command line tonegenerator: http://www.lns.com/papers/tonegen/ works fine with padsp.

Any your feedback regarding Pong Audio Spectrum Analyser or a function generator under linux is highly appreciated.

download

Download AVR 4 Studio / WinAVR files from here

Text scroll function for pong board

Filed under: Uncategorized — Piotr @ 1:11 am

After I had finished a “car race” for Pong board I switched to C. In my modest opinion Bascom is realy strange. As a preparation for my own pong version I needed some “printf” function. Unfortunately pong “screen” resolution does not offer too much space. 3 and a half simple characters pushed me to write a scroll version.

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=ZirsktlLofI

If you are going to write any text, numbers or whatever it might be interesting for you to look at the code.

I defined almost complete ASCII character set (small letters are missing). You can scroll a text from right to the left in a defined window. The text can be placed either in the SRAM or in the PROGRAM memory. It is a simple C null terminated text. The speed of scrolling can be amended with right potentiometer. In the source code you can find also a simple string print function.

Download the AVR 4 Studio / WinAVR files from here

A Car Race on Pong board

Filed under: PONG Board — Tags: , , — Piotr @ 12:41 am

Actually the first application I wrote for Pong Board from Conrad was a “car race”. This was mostly a quick & dirty prove of concept. I wanted to test the board and learn some basic features of atmega8. By the way I’ve never wrote a single code for atmega µControler before :) .

Any way here you have a next version of Need for Speed with a huge screen resolution of 12×10 pixels.

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=9cIecm-IPiI

Download the bascom source and hex files from here.

Although it was only a quick attempt to make something different from ping-pong and a learning by doing approach You can find in the source code some interesting parts.

1) I’m initializing the random generator based on the value from ADC in order to make the road different each time.

2) The road is calculated in that way that there is always enough pleace for the car. The road outline/direction changes at least after two steps forward, in order to avoid a rapid changes left-right-left-right.

Probably I will rewrite this in c and add some more features :)

January 9, 2010

GPL Free PONG on conrad.de board

Filed under: PONG Board — Tags: , , — Piotr @ 9:48 pm

Hello

During the last Xmas I finished some code for Pong Board availble at Conrad.de

Since the board is available only with a closed pong *.hex file I decided to write my onw version.

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=TvPQ2mHwC4E

Download the AVR 4 Studio / WinAVR files from here

My code provides you some additional features in compare to the “original” firmaware of the Pong Board.

You can setup speed of the game in a more convenient way. Game’s result is displayed with digits. I created a bit more complex pong physics, by calculating dynamic of the pad movement. The quicker you move your pad the bigger is an  angle the ball mirror.  If there will be any demand to elaborate this or any other part of the code let me know.

Your feedback and remarks are appreciated!

Powered by WordPress