Wednesday, April 30, 2014

Lab 15. Space Invaders. Testing module II (DAC)

I'm testing the DAC. I was initially designed the DAC to be a 4bit DAC as it was in lab13 but going a little bit through the code I've seen that the sound resources I've got are 8 bit so I had either to upgrade the DAC from 4 bit to 8bit or downgrade the sound sources from 8bit to either 6 or 4 bits. I've read that 6bits DAC makes a pretty good sound (in the other hand it will take more memory! and I've only 32k!). So I've take the decission to upgrade my DAC to 6bits and downgrade the wave sources from 8bits to 6bits.

Here are my waves:

  • explosion.wav
  • fastinvader1.wav
  • fastinvader2.wav 
  • fastinvader3.wav
  • fastinvader4.wav
  • invaderkilled.wav
  • shoot.wav
  • ufo_highpitch.wav
  • ufo_lowpitch.wav
And here it is the Matlab script to download the wave and covert it, downsample it: (watch out! this converter is for 4bits)

Anyways, my first test of the DAC module is to test that the DAC is correctly implemented, so here I show you the ramp of a 6bit DAC and a closer look of the DAC hardware implementation, that' all for today folks!





Monday, April 28, 2014

Lab 15. Space Invaders. Testing module I (LCD)

Lab 15 is the final project of the edx.org "embedded system shape the world", the target is to build a video game in <= 32Kbytes (fun, isn't it? I've got less memory than my first ZX Spectrum 48K!) so, do not expect to see here the latest graphics, music and game experience.

Let's be honest, it will be far from being a PiPhone but I think that at least I will have the same fun as its creator.

I've got to break down the project in its main modules driving, the lcd, the DAC sounds, the LEDs, the "joystick" and finally the main engine controller.

So today is the first part, the LCD testing module :-) and here it is ...







Monday, April 21, 2014

Lab 14. Measure of distance

Here we go with Lab 14. What about lab 14? Well, the amazing thing of lab 14 is how we can sense the world. The lab was about making an "electronic ruler". Basically it was the symetry of lab 13 instead of generating signal here I was interpreting signals. 

Once the lab was done and graded I had a little problem with the screen!


It was full of noisy pixel everywhere. After checking once and again every single connection, the solution was, guess what ... turn off, turn on the device! And never had this problem again

Once I put the ruler on the variable resistor, once again, guess what!, I had to calibrate! and linear regrese the values to have a lineal ruler (using excel). Now I had the lcd, here it is the setup!


And finally the electronic ruler in action here!



If you're interested in the code, check it out here.




Tuesday, April 8, 2014

Lab 13. Embedded systems shape the world. DAC

Too late to comment more than just "It's done".

Once it was done I had to implement a little op-amp in inverse mode to just hear without the headphone the tones (and hence the "musik!") produced :-)

Nothing else, nothing more, here you have the next top 10 hit! "Mary had a little lamb"


Of course, I can not let you go without the debugging session photos!








The source code if you're interested in to know how all this works, and a last video showing the first working version just out of the owen, you will see that you can hardly hear the tones.












Tuesday, April 1, 2014

Lab 12. Embedded systems shape the world. Interrupts

Well, well, here I let you a little demo of how it looks like for me the implementation of the Lab 12, interrupts.
It is just a little program that uses Systick and in the interrupt service routine just implements a little FMS (it may even be a counter) to just change the status of the push button in relation with the output tone 440Hz (A for tunning). If you click once, the tone is hold, if you click again the tone is off and on and on.

No more texto and just see the pictures and the little video :-)