Friday, February 24, 2012

How many Gadgeteers did you blow up today?

I managed (seemingly) to kill two of them.

In both cases, I had tried to upload code which just didn't get there so I hit the reset button on the Spider to get it to load.

The first time this happened I had just changed a hardware extension that I was working on and, although I had actually hit the reset, I associated the problem with the hardware.

The symptoms were that the screen came up with the usual boot-up blah blah and then seemed to "melt" in a computerised form of tunnel vision to what ended up as a "Gray screen of death"

Te upload attempt, and indeed, all subsequent ones failed. I put my hand up fairly quickly and told my client I had killed an expensive chunk of hardware and he smiled and gave me another.

Later I did something pretty similar, couldn't upload, hit the reset.... Gray screen of death.. AARRGGHH

Bob was not a happy chap.

Gadgeteer number three was working still and I took the other ones with me to see a friend who works at MS Paris. One of his guests said "Oh yeah, that happens all the time, just erase it, stick on a bootloader and update the firmware"

Well, we did this and ended up with three happy healthy FEZ Spider units again.

The reason that this seems to happen is that under certain circumstances, that seem to be more often than one would like,  the programming voltage for the EEPROM is hit and a few bytes or even bits of firmware memory can be written over. This results more often than not in a total system lockup.

The moral of the story is that if your Gadgeteer seems to be fried, don't make a keyfob out of it or chuck it in the bin until after erasing and uploading a new bootloader / firmware package has failed.

Happy hacking!!

Thursday, February 16, 2012

Safari STINKS!

Trying to use Safari on my Macbook Air is nigh on impossible. It keeps on "crashing" inasmuch as it gets half way through loading a page and just stops what its doing.
I can't be bothered to troubleshoot it so now my main browser is Chrome.

Monday, February 13, 2012

Follow me...

My blog and my web site get a lot of hits every day. I can see them on the statistics. The problem is that I'm never sure whether the page has been read or just hit by some bot. Now I know that a certain number of people do read the blog and whether you do so on a regular basis or just visit it via my web site or find it by accident is a question I'd like to answer.

I have thought of a number between 0 and 200. Follow my blog and the n'th follower who coincides with that number will recieve a $20 iTunes gift certificate from me. I'll announce the winner as soon as the magic number is reached.

Gadgeteer PWM

Pulse width modulation is a digital "trick" to fool analogue devices into thinking that a certain level of voltage is present on an otherwise digital IO pin.

Essentially, the system has a frequency, we'll say 100 hertz for argument's sake, and if the output pin remains high for the entire 100th of a second, that can be considered as the maximum output of the pin.
If however it remains high for only 50% of the time and is low the rest of the time than we can consider that the output is at 50% power.

Changing the pulse width within the 100th of a second time slice enables us to create varying levels of power and even synthesize waveforms if we so desire.

PWM on the gadgeteer is ridiculously simple. There are a number of ports that are PWM enabled. For example, the FEZ Spider has PWM on socket number 8 amongst others.

To set-up PWM on any PWM enabled pin we simply need to declare the PWM controller like so:
private PWMOutput pwm = null;

Then in "ProgramStarted" get the PWMOutput controller:

pwm = this.extender.SetupPWMOutput(Gadgeteer.Socket.Pin.Nine);

Then, to set the power of the pulses:

           
pwm.Set(x,p);

where X is the overall base frequency of the PWM signal and p is the value 0-100 of the percentage of power to set.


The video below shows Pulse Width Modulation in action on my oscilloscope.



I wired some LEDS up to the Gadgeteer and they changed brightness like so:








Tuesday, February 07, 2012

UsbHost.USBDriveConnected

Had a little problem with the Gadgeteer yesterday. I was using the UsbHost to read files from a pendrive and after copying files to the drive, verifying that the files were present and plugging it into the Gadgeteer I discovered that the event which is supposed to fire (USBDriveConnected) never did!

After a lot of head scratching I discovered that the pendrive was formatted in NTFS. The UsbHost software only recognises FAT format drives so be sure to get that bit right when you transfer files to your gadgeteer.

Monday, February 06, 2012

Gadgeteer

Simple, brilliant, works... When you can find any information at-all. I can't find a single example of how to use the usbHost.USBDriveConnected event which doesn't seem to fire anyway.

Hey Microsoft. The documentation could do with looking at!!

Software Passion 2012 in Göteborg Sweden

Come along to the Software Passion Summit in Göteborg Sweden on 19th and 20th of March 2012. I'll be speaking on Tuesday the 20th.

You can get a 10% discount by booking through this link and using the promo code "BOB" when you book.

See you there!

Thursday, February 02, 2012

I am the proud owner of a Macbook Air

Its sooo thin!!! I'm just installing Windows 7 and Visual Studio in a VirtualBox VM ready for Techdays Paris next week.

I'm rather hoping that putting the apple devtools, mono, monotouch and monodroid as well as VS and WP7 SDKs wont overload it.


- Posted using BlogPress from my iPhone