Archive for October 2009

TCP/IP getting there

October 28, 2009

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.



October 18, 2009

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!

October 10, 2009

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!

October 9, 2009

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!

PCB Design getting there

October 1, 2009

So i done some work on it again and got the PCB design all done. I still need to think it trough to make sure i didn’t miss anything important.

There aren’t many changes from the schematic before. Here the pins are swapped so that they are the easiest to route on the PCB and the big pile of SPI memory ICs. There are 5 together on the SPI bus for general purpose storage and 1 to serve as a buffer for playback. I don’t plan to actually put all 5. Its so if i run out of memory i can simply solder another memory IC in there. The memory chips are FRAM so i can use this memory for eater temporary working memory or long term memory since FRAM has the speed and durability of RAM while beig nonvolatile.

xmos board drw

xmos board2 3d

xmos schem2 tunimb