Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Networked music player using the mini


  • Please log in to reply
71 replies to this topic

#21 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 25 March 2011 - 08:12 PM

Really glad for those encouraging words Terry, thanks!

#22 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 26 March 2011 - 04:34 PM

This time I was stupid and cheap not to follow my own beliefs in redundancy - should've bought two or more MRF24WB0MB while I was at it. While waiting for the new one to arrive, I ran some more tests on the old one. Turns out it's not entirely dead after all, when sniffing the DEBUG_TX pin I get this message:

Current Boot is ROM.
Boot Select is FlashBoot.

Rebooting from flash.


Current Boot is ROM.
Boot Select is FlashBoot.
ROM and PATCH Version = 0x1204

I would expect more output than that so my guess is that I accidentally erased the flash on the poor thing so I'll just have to find a way of reflashing a MRF24WB0MB wifi chip from Microchip. If anyone happen to know how, please let me know.

#23 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 28 March 2011 - 01:02 AM

Oh boy, couldn't wait for the new wifi chip so instead I started working on a driver for a 10$ ENC28J60 board. That one too behaved very strange and it's been driving me nuts for the last 24 hours. I was at the point where you'd randomly try almost anything and that's when I discoverd that pin 13 that I used for chip select didn't function at all. Switched to another pin and voilla, problem gone! So now I'm bound to give the old wifi chip another go...

#24 Terry Massey

Terry Massey

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • LocationPekin, IL

Posted 28 March 2011 - 01:30 AM

sweet would you be interested in shareing the drivers when your done. I have been looking at the same chip and was thinking about using it.
Thanks,
Terry Massey

#25 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 28 March 2011 - 05:38 AM

Sure, I was planning to but for starters I'm only porting the uIP driver alone, not the whole stack. Initially, I'm only looking to do some very basic UDP(?) stuff with it, not quite sure yet what I need plus it seems others are at the stack as we speak (there's a separate forum area for it). Btw, you do mean the wired enc28j60, yes?

#26 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 31 March 2011 - 12:30 AM

Got ethernet, link's up dude :)

My uIP device driver port works and the enc28j60 NIC (see attached image) now connects to my LAN. Link and Rx/Tx leds are blinking but there is no TCP/IP yet. Not sure I'm up for that kind of porting work so I might stick with raw ethernet frames for a while.

I'll post the driver code soon, must make it pretty first though...

Btw, does anybody know of any nice Windows (XP) freeware for sending/receiving raw ethernet frames to any given MAC address?

Attached Files



#27 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 31 March 2011 - 07:43 AM

I'll post the driver code soon, must make it pretty first though...

That would be lovely! I ordered a enc28j60 myself a couple of days ago since it's the cheapest ethernet solution. I ordered this one: ENC28J60-H Ethernet Controller Board.

Btw, does anybody know of any nice Windows (XP) freeware for sending/receiving raw ethernet frames to any given MAC address?

Is WinPcap something for you?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#28 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 31 March 2011 - 11:54 AM

That would be lovely! I ordered a enc28j60 myself a couple of days ago since it's the cheapest ethernet solution. I ordered this one: ENC28J60-H Ethernet Controller Board.

Is WinPcap something for you?

Cool, really like the formfactor of that tiny board. I'll look into WinPcap tonight, can't wait to send/receive packets to/from the mini :)

#29 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 31 March 2011 - 11:48 PM

Ok, so attached you will find the source code of my C# NETMF port of the uIP device driver for the ENC28J60 ethernet controller chip from Microchip.

Beware that the driver is in a very early stage and hasn't been properly tested, in fact it has hardly been tested at all. Remember that you won't be able to do any TCP/IP stuff with this since it's merely a driver. However, it should be able to send and recieve ethernet frames using the test project provided.

I added interrupt handling producing .NET events but you can poll for data too if you like.

Hopefully this driver will become part of the, soon to be, full NETMF port of Andreas Dunkel's TCP/IP stack, called uIP discussed here.

Please report any bugs, should you try the driver, Enjoy!

EDIT: Attached driver source code updated to version 1.0.0.2:

Attached File  hanzibal_ENC28J60_uIP_driver_v1.0.0.2.zip   18.11KB   153 downloads

#30 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 02 April 2011 - 02:03 AM

Driver seems to work pretty well for receiving ethernet frames, these are excerpts from my debug window:

ENC28j60[01/01/2009 03:41:09] --> IRQ_PKT: frame(s) arrived
################################ Program.Main[01/01/2009 03:41:09] --> IPv4 packet from 0004a3108426 to ffffffffffff of size 14
ENC28j60[01/01/2009 03:41:10] --> IRQ occurred
ENC28j60[01/01/2009 03:41:10] --> IRQ_PKT: frame(s) arrived
################################ Program.Main[01/01/2009 03:41:10] --> IPv4 packet from 001f33d89580 to 01005e7ffffa of size 14
ENC28j60[01/01/2009 03:41:14] --> IRQ occurred
ENC28j60[01/01/2009 03:41:14] --> IRQ_PKT: frame(s) arrived
################################ Program.Main[01/01/2009 03:41:14] --> ######## Message -->HELLO NETDUINO MINI
################################ Program.Main[01/01/2009 03:41:14] --> ARP packet from 0013721554af to 001ec001b46b of size 14
ENC28j60[01/01/2009 03:41:15] --> IRQ occurred
ENC28j60[01/01/2009 03:41:15] --> IRQ_PKT: frame(s) arrived
################################ Program.Main[01/01/2009 03:41:15] --> IPv4 packet from 002401764009 to 01005e7f0001 of size 14
ENC28j60[01/01/2009 03:41:18] --> IRQ occurred
ENC28j60[01/01/2009 03:41:18] --> IRQ_PKT: frame(s) arrived
################################ Program.Main[01/01/2009 03:41:18] --> ARP packet from 002401764009 to ffffffffffff of size 14
ENC28j60[01/01/2009 03:41:18] --> IRQ occurred
ENC28j60[01/01/2009 03:41:18] --> IRQ_PKT: frame(s) arrived
################################ Program.Main[01/01/2009 03:41:18] --> ARP packet from 002401764009 to ffffffffffff of size 14
ENC28j60[01/01/2009 03:41:19] --> IRQ occurred
ENC28j60[01/01/2009 03:41:19] --> IRQ_PKT: frame(s) arrived


It's mostly broadcasts (I guess) and other devices talking over my LAN because I haven't set any filters on the ENC28J60. Notice the "HELLO..." in there, that's actually me saying hello to my mini from my PC Posted Image

#31 Terry Massey

Terry Massey

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • LocationPekin, IL

Posted 02 April 2011 - 02:30 AM

very nice... I like now to get mine all hooked up. and make it work.
Thanks,
Terry Massey

#32 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 03 April 2011 - 10:44 PM

Still waiting for the new wifi chip so I did some tests using my iPhone to control the mini. Here's a screen shot from the iPhone remote control app:

Attached File  iPhone_Netduinno_mini.PNG   39.67KB   93 downloads

And here's a little video clip:

http://www.youtube.c...h?v=cTejXWsbvmU

Sorry for the bad quality and general shakyness...I'm actually using an iPod touch as a remote while shooting with my iPhone....and that requires a little more coordination than I'm capable of Posted Image

It might not show in the video, but response is instant and it works very well (I kept fat-fingering the buttons in the video). For now control is only one way and since I don't have tcp/ip I built a very simple protocol ontop of ethernet. For the same reason, I'm also cheating by using my PC as a kind of gateway for converting messages from iPhone via WLAN into wired ethernet to the mini.

Can't remember when I had this much fun, I really love my new found hobby Posted Image

#33 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 04 April 2011 - 05:46 PM

I have updated the uploaded source code for my ENC28J60 based uIP driver (earlier attached) to version 1.0.0.2. Enjoy!

#34 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 19 April 2011 - 11:03 PM

My only sound related problem right now, is a low level background beep which I think is coming from SPI speed switches. These are creating spikes that are induced and transferred to the amplifier. The beep has different frequencies depending on the bitrate of the song being played due to different intervals between SD reads. Also the beep disappears for a short while when skipping to another song as no SD reads take place during a deliberate delay in code.

Any ideas of how to get rid of the beep?

Sound-problem gone, made some changes in another matter and don't really know what did the trick, probably some bad wiring. The system plays excellent, you'd be surprised to know what that little bug can do.

I think this is as far as I'll go with this project so thanks all, it's been great fun!

#35 Dezorian

Dezorian

    Member

  • Members
  • PipPip
  • 24 posts

Posted 30 May 2011 - 09:03 AM

Sound-problem gone, made some changes in another matter and don't really know what did the trick, probably some bad wiring. The system plays excellent, you'd be surprised to know what that little bug can do.

I think this is as far as I'll go with this project so thanks all, it's been great fun!


Awesome project! I'll be looking in to hooking up this MP3 Shield to my project. Did you share your library for playing mp3-files on the vs1053 somewhere? I'd love to use it!

Thanks

#36 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 06 June 2011 - 10:49 PM

Awesome project! I'll be looking in to hooking up this MP3 Shield to my project. Did you share your library for playing mp3-files on the vs1053 somewhere? I'd love to use it!

Thanks

Hi Dezorian!
Sorry for a late reply, been on vacation for a couple of weeks. The shield seem's perfect and my code is bound to work there as well. However, currently beeing in a patent pending situation, I regret not beeing able to share the specifics at this point.

As I don't really expect to actually get a patent, this might suddenly change anytime soon and then I will happily give everything away.


Btw, what do you plan to do with the vs1053 shield?

#37 Alex531

Alex531

    New Member

  • Members
  • Pip
  • 8 posts

Posted 20 September 2012 - 04:17 PM

Were you able to get your patent for this project?

#38 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 21 September 2012 - 02:15 AM

Unfortunately not (what was I thinking?) so I can dig out the source if you're interested. Haven't worked with this project in a good while and beware it's bit of a messPosted Image but PM me your email address and I'll send you the core of it.

I actually have one patent (eligible in Europe only) for a software method but it's very hard to get patents on software these days - and actually, I think it should be since I don't really like patents anymore.

It's really kind of funny because the patent is actually about compiling a mash of HTML markup and scripts into a binary module that can be executed by a web server. My patent was filed not long before Microsoft introduced ASP.NET which basically does precisely that.

I guess, if I had the time and money for a lawsuit, I could bring MS to court and maybe get billions in settlementPosted Image See link below.

http://patentscope.w...en/WO2004029801

I actually also went along and developed an ISAPI extension (or what's it called) for IIS4. Quite a nifty little thing if I may say so it executed virtual pages residing in the binary module and so there where no pages on disk other than static content (i.e. images and such) because back then I was unable make these into embedded resources. Also it drastically increased pageserving performance compared to conventional methods involving the interpretation of code. The binary module also contained functionality to act as a proxy with integrated cache and network load balancing. I called it the "asp compiler" because it could take an existing asp web site and turn it into a single DLL-file by the click of a button and suddenly companies could distribute their server side software like any other (i.e. desktop software on a CD) without giving away their trade secrets. It was really something but along came MS ASP.NET and my compiler turned from gold into sand over night and became pretty much pointless Posted Image

#39 Alex531

Alex531

    New Member

  • Members
  • Pip
  • 8 posts

Posted 21 September 2012 - 11:46 PM

Unfortunately not (what was I thinking?) so I can dig out the source if you're interested. Haven't worked with this project in a good while and beware it's bit of a mess :rolleyes: but PM me your email address and I'll send you the core of it.

I actually have one patent (eligible in Europe only) for a software method but it's very hard to get patents on software these days - and actually, I think it should be since I don't really like patents anymore.

It's really kind of funny because the patent is actually about compiling a mash of HTML markup and scripts into a binary module that can be executed by a web server. My patent was filed not long before Microsoft introduced ASP.NET which basically does precisely that.

I guess, if I had the time and money for a lawsuit, I could bring MS to court and maybe get billions in settlementPosted Image See link below.

http://patentscope.w...en/WO2004029801

I actually also went along and developed an ISAPI extension (or what's it called) for IIS4. Quite a nifty little thing if I may say so it executed virtual pages residing in the binary module and so there where no pages on disk other than static content (i.e. images and such) because back then I was unable make these into embedded resources. Also it drastically increased pageserving performance compared to conventional methods involving the interpretation of code. The binary module also contained functionality to act as a proxy with integrated cache and network load balancing. I called it the "asp compiler" because it could take an existing asp web site and turn it into a single DLL-file by the click of a button and suddenly companies could distribute their server side software like any other (i.e. desktop software on a CD) without giving away their trade secrets. It was really something but along came MS ASP.NET and my compiler turned from gold into sand over night and became pretty much pointless Posted Image


I took a look at your patent, was a great idea. Thank you for your time and help.

~Alex

#40 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 22 September 2012 - 08:05 AM

Hello again!

I decided to publish the essence of the source code in the thread and so here it is implementing an SD card music player using the vs1053B chip from VLSI. The player uses a (IMHO) rather nifty technique to accomplish 320kbps CBR mp3 playback. It can also play high quality Ogg Vorbis, wav, wma, midi and a few other formats. For more details, see the homepage of the vs1053b chip:
[url="[url="http://www.vlsi.fi/en/products/vs1053.html"]http://www.vlsi.fi/en/products/vs1053.html"]http://www.vlsi.fi/e...cts/vs1053.html[/url][/url]

 

[color=#ff0000;]EDIT: Code upgraded to v1.0.0.2 correcting endless loop issue.[/color]
Attached File  SDPlayer_v1.0.0.2.zip   6.63KB   53 downloads

The project implements a music player that repeatedly plays all files (i.e. mp3, ogg, wav, midi, etc. ) from an SD card, The code is for the Netduino mini and the wiring should be as follows:

Netduino Mini vs1053b
SPI <-> SPI (clk, di, do)
Digital 5 -> resetPin
Digital 6 <- dreqPin
Digital 7 -> xcsPin
Digital 8 -> xdcsPin

You can of course modify the code in order to use other pins. Please let me know if you run into any problems. Also, I used this vs1053b breakout board from SparkFun:

[url="[url="https://www.sparkfun.com/products/9943?"]https://www.sparkfun.com/products/9943?"]https://www.sparkfun.../products/9943?[/url][/url]

Cheers!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.