New toy!

Posted March 24, 2010 by Bernard Klinc
Categories: General

Today i got something special in the mail. A cute little XK-1 development board and a XTAG2 debuger to go with it. I won this thing on the xcore exchange forums as part of the activity points based giveaway.

So what is this board. Its heart is the  XS1-L1A chip, that is a single core 400MIPS processor with 8 threads and 64K of memory. Along on the board there are 4 LEDs and 2 pushbuttons that are wired to the I/O pins. There are also two expansion headers that bring out the I/O and power supply. The main feature of the board is the connector on the other side of the programmer. It allows multiple boards to be stacked together to connect over xlinks and share power. This way you can expand the system with ease.

Sound Card PCB

Posted December 17, 2009 by Bernard Klinc
Categories: General

Okey so enough of PWM for audio, its time to get serious ! So i fired up Altium again and went on designing a proper sound card for the XC-2, and quite a sound card it is with its capabilitys reaching up to 192Khz at 24Bit. Still while packing a punch it remains quite tiny at 25x40mm only and half of the room are the big 3.5mm jacks. There is also a small 8 pin oscillator on the board that provides the necessary clocking to the DAC/ADC chip. The thing can be configured over SPI, I2C or hardwired setting on power up. I2C is also used to change the system clock if needed as the oscillator has a I2C port.

Only downside of it is meaby that the line out on it dose not have much current capability so its not built to drive headphones directly.But in any case it should provide top quality audio when it gets built(Well i hope it works when i build it…)

WAV Player video demo

Posted December 12, 2009 by Bernard Klinc
Categories: General

So i made a little video showing the wav player in action.I polished out the code a bit and added a LCD to show some info.

Project source code: Link…

SD Cards and wave files

Posted December 9, 2009 by Bernard Klinc
Categories: General

Remember that SD Slot i made last time? Well i actually put it to use and interfaced those cards to my XC-2.

Okey so how about doing something neat with it? How about playing *.wav audio files from the card. But how do you get a analog audio signal out of a XC-2, well i went for the quickest and simplest way of doing that. Its PWM going trough a RC low pass filter and out to a audio jack trough a dc blocking cap. Its not really the best DAC in the world but it works quite good actually. So all i needed then is a buffer to keep feeding the PWM generator with data at exactly the right speed to match the wav files sample rate.

DAC sawtooth test:

Hello LCD

Posted December 5, 2009 by Bernard Klinc
Categories: General

I went with doing something simple for a start and decided a LCD could be pretty useful, so i made it interface a simple 2X16 character LCD module. Something amazing happened too, the display shown up the text the 1st time i ran my code! Woah! Things tend to never work on the 1st try as there is always something that gets overlooked, but this cute little display must like me.

The code still needs a little work to make it easier to use and gota make a channel server/client so i can use it as a nice debug screen.Also need to get in some USART too, so i can have a terminal window (Yeah i love those for debug).

Some Hardware

Posted December 3, 2009 by Bernard Klinc
Categories: General

So after some time i started a bit on hardware to plug on to the development board.

First thing i did was solder some header connectors on to my XC-2 as the board comes with no connectors to allow you to use the connector of your choice. I just used female headers on the bottom of the board. I put then there because i found that the ethernet jack on the top is too tall to allow board stacking with standard headers while there are no problems on the bottom.

A simple thing i that came to my mind was a SD card interface. Hmm i don’t have a SD card slot to use on it, so the better way of doing things. DIY it! This is a SD card slot built out of a small piece of prefboard and a few header pins and coper wire. I made one of those before when i needed a SD slot when interfacing a dsPIC to it(it ended up very reliable too).So all i did was make a copy of that one and put a two row header to plug in to the XC-2 board. Next time you need a SD slot fast, just grab a little prefboard and some header pins.

The 2nd thing in the photo is the mess of wires that can be used to connect pins of a connector on the XC-2 to a breadboard for quick testing of a piece of hardware on it. It might come very useful to do some quick stuff on it.

I didn’t start on the software for this stuff yet tho. I hope to get some done soon.

TCP/IP getting there

Posted October 28, 2009 by Bernard Klinc
Categories: General

winsock_firstsitePhew after some work i finally crunched together a winsock like API for the TCP/IP stack. This is the fist website served by the API ran by a simple 10 or so lines of webserver code. The API is still far from perfect but this proves that the thing actually works. I will finish it as soon as possible so i can start playing with different things.

The API provides the easy to use basic calls to interface the TCP/IP stack, it also takes care of buffering, retransmission etc. It may not be the most efficent but it gets the job done and dose it with little code.


Posted October 18, 2009 by Bernard Klinc
Categories: General

So first of all my PCs monitor died so there was some delay, now i got a new LCD to get things moving again.

But now that i tried getting some TCP/IP code working it was nothing but frustration. What i went on doing is striping the XC2 webserver exsample down to the bare TCP/IP code, but later found out its a far more complicated task as i first toght. There is a lot of code, but whats the problem is that the code is tightly glued together. So its very hard to determine whats needed and whats the webserver code i want to get rid of. I am thinking of abandoning this approach and do something else. Meaby take the raw MAC exsample and stick a tcp/ip stack on top of it or something.

Anyway this TCP/IP is not the plain sailing i expected it to be.

Blinky blinky!

Posted October 10, 2009 by Bernard Klinc
Categories: General

Thanks to the nice tutorials that come with the development environment , i was blinking LEDs in no time! But as this thing is not one of those beginner arduino kits or such the tutorial quickly jumps in to teaching you how to write multithreded programs that run on multiple cores. The stuff can be a bit confusing at first since you are basically learning a new language called XC.  But its pretty much the same as C,  just with a few twists in it to allow multitasking and all these unique xmos features.

100_2636It went great until i got to the Ethernet part. I just couldn’t get stuff to compile but it thourned out to be a little compatibility issue and a wrong make file problem. But once i got it sorted the thing worked beautifully. I did a lot of reading also on how to program in XC so its a little more clear now and also digged in to the guts of the IP stack o understand exactly how it works.The job im working on now is getting a nicely working TCP/IP base. I plan on simply riping the webserver example apart til i get down to the TCP/IP port level. Since from that level up i can implement almost any service (from a webserver to FTP to sending e-mails) As far as i got trough the webserver code i see that it should not be very problematic as a open source TCP/IP stack was used. The stack is quite well documented so tomorrow im expecting to have a finished TCP/IP base and start fooling around with it.

Also found a nice Ethernet debugging tool while researching how the IP stack works. Its called WireShark and its a program that can display the raw data going trough the network card while analising it. I love this software as it bypasses everything and grabs the raw data right off the ethernet card. Only problem is that my network card is usually quite busy (IM,Mail,WebRadio…) so WireShark displays a whole pile of various traffic going all over the place. Im thinking of garbing a network card thats laying around and stick it in to PCI , then instead of plunging the xmos board in the router i could plug it in to the PC directly. That way i wouldn’t see any other junk on the line and i could see stuff that is going to other IPs as well.

The development board is here!

Posted October 9, 2009 by Bernard Klinc
Categories: General

xmos boxI always get exited when cool electronics come in the mail, but this time i had a reason to get even more exited then usual as i got the XC2 board from xmos today!

First off i have to complement the nice box it comes in.Most stuff comes in a cardboard box wrapped in plastic. But they acualy put some effort in to making the box something special.

So what came inside it:
-XMOS developlent board
-XTAG to USB interface
-miniUSB cable (With a nice winding mechanism)
-5V adapter with plugs for most countrys

So i quickly garbed a spare network cable and plugged it in. The demo program on it worked like a charm hosting the demo website on my LAN. I still need to get the XTAG interface figured out and try making my first program for it.(You guessed it ! A good’ol led blinking program)

I know i wont be bored this weekend!