Quick USB Power Fix

February 10th, 2010 No comments

I’d like to let everyone who has received a baked Mikeycard  phase 1 spin 2 card to know that it there is a simple fix to get the board to power over USB. The pull-down resistors connected to D0, D1 and D2 lines of the LTC4088 LiPo charger IC are too large so that the lines are never go low. The fix is to replace R27, R28 and R29 with smaller value resistors. I’ve replaced the 10k originals with 1K value resistors and the board now powers up immediately when plugged into USB.

The explanation for the original behaviour  can be found on Table 1 on Page 11 of the datasheet. With the original resistors the D0, D1, and D2 lines are all high thus the LiPo IC is in 2.5mA (Susp High) mode which is insufficient power to boot the CPU, obviously. I measured ~0.8V on plugging in a USB cable to my board with the original pull-down resistors in place. The datasheet indicates on Page 4 indicated that V(IL), that is Input Low Voltage maximum for D0, D1 and D2 is 0.4V.

The pull-down resistors must pull-down D0, D1, and D2 to an acceptable low logic voltage on USB plug-in. Fix your three pull-downs and you’ll now have a board that boots when plugged into USB power only.

Eric

Some catching up to do

January 13th, 2010 No comments

Hi,

In the past few weeks we have:
- added dgbUART to the board;
via E6 and E7 you can get some feedback from the board over a serial FTDI cable.
- found out what kept the board from running on USB only;
cutting the wire from R27 to the CPU is rather drastic but works.  I would like to find a nicer solution.

Yesterday I’ve done a particular good thing that is to the benefit of the whole human race. The guys at RevSpace, your friendly hackerspace here in The Hague, had some carcasses of CBM64 machines lying around.  We managed to get one machine in a (somewhat) working state again. :-) SYS64372 forever!

Cheers,

Tom

Meetings

December 18th, 2009 No comments
26C3

26C3

December,  pure white snow, the red guy with the big beard and a thousand other reasons are good to organize a get-together with a few like minded (RFID) enthusiasts.

I hope to speak / see / write them all coming Saturday. We’re having a virtual Skype and IRC meeting starting at twelve GMT.

Next to that I’ll be going to watch the dragons in Berlin between Christmas and New Years. That’s going to be lots of fun. I’m hoping to have a face2face and beer2beer meet with Roel , Henryk , Eric, Andrei and hopefully Pavol too. That would be great!

Drop a line if you want to join.

Cheers,

Tom

Last month, summarized

December 8th, 2009 2 comments

1.) Exporting

The last 3 Mikey devices were sent to Rconty in France, Izico & Nemo in China and to Eric P in Canada. They all came with the antenna from Roel, this one from SonMicro.

Here are some pictures of Mikeys with antenna’s assembled. The one of Izico front and back and the one of RConty front and back.

And here is a high res picture of mine. It’s not to show of the super quality soldering work (wink) it’s more to give people the opportunity to check if their device arrived without parts missing.

2.) Coding

I would have liked to have made more progress in this field. Not much has been going on. I’ve not been able to get a Mikey going with Eclipse and all the Open Source tools. Instead I had to commit a sin and use IAR. It’s not open but it’s easy to use and for a dumbo like me that’s my tool :-) It comes with a lot of exaples and I’ve managed to rewrite the Board file for the Mikey, at least partly. And I’ve got there ‘ getting started’ app to work. A few leds blink every x milliseconds, pressing the button generates an interrupt and that triggers the blinking of another led. Pretty easy to do.

3.) On to the next

The plans for the next version become more clear.

  • Switch CPU. It’ll be the SE version of the SAM7 which has native support for all kinds of memory.
  • Hence add a NAND flash. 2Gbit is dirt cheap and more then enough to store cards and logos.
  • Add a touch screen. Thanks to Izico I’ve managed to get my hands on 20 touch screens, 320 by 240 pixels with 64k colors on  2.4 inch. They are a sweet bunch. More info here.
  • Add good vibrations. A small vibrating motor for that extra kick.
  • Add a lo-freq emulator, like this one and a lo-freq reader with this chip from Melexis; my fellow countrymen.
  • And of course clean up the bugs like make SAM-BA work, use an A/D port to measure the voltage on the battery, take R6 away and last but not least communicate with PN532 via either HSU, SPI or I2C.

4.) Produced some wetware
Next to some neat hardware there’s also some cool wetware coming. It’s going to be delivered around the end of May or the beginning of June. He or she will be the coolest thing around … no Mikey in sight :-)

That’s about it.

Cheers,
Tom

Baked 3 new Mikeys

November 8th, 2009 No comments

For those who did not knew or noticed, the last two posts were by CyberGibbons. (check the CG on the board, under Rev: 002). He’s doing some great stuff on both hard and software level.

Today, I’ve managed to bake 3 more devices. These will go to interested parties that want to help with the firmware and general software development. Hopefully that will speed up  development of software.

Next on my list is making ‘ use cases’ for Mikey. Thinking of those made me dream about how the next spin or phase should look like. There’s a thread in the forum about all new & cool stuff I want. Put there what you would like to see.

Sadly enough I did not get any PCB antennas in (yet). Maybe I’ll just figure out a wire antenna for now. Anyway to much to do and not enough time. See you all later.

And before I forget, big thanks to Cybergibbons for the work and blog post!

Cheers,
Tom

Let there be (flashing) light(s) Part 2

November 8th, 2009 1 comment

The next stage was to flash the memory with something a bit more useful that an arbitrary bin file!

For this, we need a toolchain. I’m currently working on a Windows PC, and the Olimex ARM-USB-OCD came with a CD – ARM GCC for Windows Dummies. This installs the Yagarto toolchain, along with Eclipse, Zylin and OpenOCD. It (mostly) worked out of the box, though I did need to explictly define several paths as there are about 4 versions of “make” on this PC.

There is a good tutorial and set of examples here (warning, large zip) that help you get a Windows toolchain set up.

I then decided to take one the simple flashing examples, cut it right back to the bare minimum, and flash the LEDs on the Mikeycard. I changed the PLL setup in LowLevelInit.c as per the earlier post, and just toggled the IO pins inside a while loop. After a couple of tries and sorting out basic mistakes, the Mikeycard was alive!

The code I have used can be downloaded mikey-at91sam7s512 and the resulting main.bin as well.

I believe Roel has managed to compile the same code under Ubuntu.

Let there be (flashing) light(s) Part 1

November 8th, 2009 No comments

After receiving my JTAG connector, LiPo battery, and Olimex ARM-USB-OCD, I could finally set to work getting the Mikeycard to do something!

The first task was to ensure we could communicate with the processor using the JTAG interface and then flash a .bin file to the internal flash memory. This should have been a fairly easy task – there are quite a number of OpenOCD config files kicking around for the AT91SAM7S series of processors.

Everytime I tried to flash (and then verify) an arbitrary .bin file, I was getting failures or errors. It was at this point that I noticed that some of the lockbits were set on the flash (this can be seen with the “flash info 0″ command in OpenOCD). So I tried clearing these bits with “flash protect 0 0 15 off”. However, OpenOCD was again showing errors.

Not working...

Not working...

At this point I stripped the OpenOCD config file back to the bare minimum, leaving the processor to run from it’s internal 32kHz clock. This time I could clear the lockbits, and flash the memory successfully.

So, it looks like the clock isn’t running correctly using the default values in the OpenOCD config files. What do all these registers actually do? Let’s look at the appropriate part of the file:

mww 0xfffffc20 0x00000601       # CKGR_MOR : enable the main oscillator(18.432MHz)
mww 0xfffffc2c 0x00481c0e       # CKGR_PLLR: 96.1097 MHz(18.432MHz/14*(72+1))
mww 0xfffffc30 0x00000007       # PMC_MCKR : MCK = PLL / 2 = 48 MHz

The first memory write to 0xFFFFFC20 – what do those bits mean? The first bit tells the processor to enable the external oscillator. Bits 8-15 represent OSCOUNT – the delay until the oscillator has stabilised. I popped the oscilloscope onto the external oscillator, and when this command was issued, the oscillator successfully started up. It did take longer than I would expect, so we may need to increase the 6 to something larger later, or tune the load capacitors slightly.

Showing the length of time taken for the oscillator to stabilise

Showing the length of time taken for the oscillator to stabilise

Even with the external oscillator running, the processor is still using the internal clock, so at this stage I was still able to flash successfully.

What about the next command that writes to 0xFFFFFC2C? This is to set up the internal PLL which can be used to adjust the clockspeed as required. The 0x00481C0E value seems common, but again, what do the bits mean?

0-7 is the PLL DIV
8-13 is the PLL COUNT (how long to wait for it to stabilise, similar to OSCOUNT above)
14-15 is the PLL output frequency range
16-26 is the PLL MULT

So – the common value of 0x00481C0E means divide by 14, wait for 28, output freq range is 0 (80-160Mhz), and the multiplier is 72. This gives an output frequency of 96.1097 MHz.

The next command – this changes the oscillator source from the internal one to the PLL, and sets the PLL prescaler (another divider) to 2. This means that the processor should now be clocked at about 48MHz.

However, at this stage I can no longer write to the flash.

What happens if I set the prescaler to 4, giving a clock speed of 24MHz? It’s now working. Maybe the processor won’t run at higher speeds?

I then tried it using a different multiplier/divider ratio (96/6), which with a prescaler value of 4 should give us approximately 50Mhz. Surprisingly, I could still flash the memory.

What’s going on here? I’m not sure. My suspicion is that the values of the capacitors and resistors in the external PLL filter aren’t quite right, and for whatever reason the usual PLL settings just won’t lock correctly.

Cybergibbons

We have blinking LEDs

November 2nd, 2009 No comments

Just a quick note to say that CyberGibbons has coded a program that makes all LEDs blink!
More to follow soon….

Ready to code

October 22nd, 2009 No comments

Just added a Google code project.

Here: http://code.google.com/p/mikeycard/

Fresh from the oven

October 22nd, 2009 No comments

Baking them in pairs now. :)

Cheers,
Tom