Showing posts with label JTAG. Show all posts
Showing posts with label JTAG. Show all posts

Thursday, April 9, 2015

Prototyping with EMW3162 "IoT" devices.

I've picked up a bunch of EMW3162 devices recently. I don't yet have any up on Anibit, I'm trying to figure out how many I want to keep and and many I could part with.

EMW3162 Overview


They are really neat little devices:

The Good


  • Price: Runs in the neighborhood of $10 USD
  • Wifi b/g/n, reportedly up to 54MBps
    • On-board chip antenna, and UFL connector for an optional external antenna
  • Included STM32F205 ARM Cortex-M3 120MHz CPU with 128kb SRAM and 1Mb of Flash
  • About 20 available IO pins (+2 on board LEDs, and JTAG/SWD breakout)
  • Uses Broadcom Wifi chipset, compatible (after some finagling) with their WICED sdk
    • Broadcom has a lot of support for "IoT" in their SDK, with appliance samples, Access Point setup, and embedded web server support.
  • Mostly (but not all!) 5V tolerant I/O pins. (I love that, level shifters are such a pain)

The Bad

  • Documentation for the device itself, is almost non-existent. 
    • You must rely on the documentation for the constituent parts, and the work of some industrious hackers, see this
    • If you can read Chinese, you may have better luck.
  • It's not straightforward on how to use it as simply a Wifi adapter for an external Microcontroller. I believe there are firmwares for this, but it will require a lot of research.

The Ugly

  • 2.00 mm pitch headers on the breakout. Who does this, seriously! I think MxChip must have hired the person who came up with the XBee socket.
  • The various SDK and libraries are a slight licensing minefield. If you want to use this for a closed source or proprietary application, read through all the licenses of all the sub-parts carefully. There are some "free for closed source commercial" library license options, but not all of them are. 

Prototyping

I have thrown together a quick and dirty adapter PCB to let you mount the EMW3162 on a breadboard. I'm considering possibly doing a run of kits for the adapters to get the cost down, we'll see. 

You can get your own adapter from OSH Park here. [Updated link to new version here] Use at your own risk, I have not received my boards yet to verify that it works, but a paper printout looked like it matched up, and the actual circuit is so simple. You will also need:
  • 2 15-pin 2.54mm (0.1") pitch male headers for the breadboard part.
  • 2 15-pin 2.00mm pitch male headers for the EMW3162 module, unless you already have them mounted.
  • 2 15-pin 2.00 pitch female headers to receive the EMW3162 on the adapter.

Comparison to ESP8266


The main advantages of this over the popular with makers ESP8266 is that it has many more pins broken out, and they are 5V tolerant, making this device a better candidate for standing on it's own as an appliance vs acting as a peripheral for another Microcontroller. The CPU of the EMW is also faster (120 Mhz, vs 80Mhz), and has a lot more on board RAM and Flash space. Also, the WICED SDK from Broadcom is very sophisticated, with support for features such as OTA updates to the device. You can develop code to run directly on the ESP8266, but the support for that is more community built than officially supported. To be fair, WICED does not officially support the EMW3162, ether, but the board is close enough in design to other officially supported devices that it's not very hard to port.

Though the EMW3162 is about twice the price of the ESP8266, for some applications, it is worth it, especially if the extra capabilities allow you to remove external components form your design.

Resources to get you started

  • Several folks have started an analysis as a Hackaday project, and they're adapting their own flavor of the WICED sdk for use with the board.
  • The WICED SDK, which includes an Eclipse/CDT tailored to embedded devices using Broadcom chipsets.
  • The Github Repo for the WICED fork specific to this board.
  • Seeed studio sells a couple Development boards you can plug your 3162 into. This one has a JTAG port for an external JTAG, and this one has an on board JTAG built in.
  • My breadboard adapter you can order in multiples of 3 for $8 per set (you'll need to find the headers separately)

--P




Thursday, January 31, 2013

CNC update

I hit a milestone with my CNC project tonight, I made my first cut!

Here's the current state of it configured for milling:



I'm using the Zen Toolworks 12x12 , F8 edition. The F8 edition has an extended Z-axis travel on the gantry, which is needed to be able to use the device for 3D printing. One thing I didn't realize initially were that: 1) configured as a milling machine, the spindle will not reach down to the bed, and 2) the extra Z axis travel does not benefit milling as much, because the gantry clearance is one of the limiting factors. The two possible approaches to address the first issues are to either re-work(ie invent your own) the spindle mount to lower it close to the bed, or to build an elevated platform as your new work area. I decided to do that because it reportedly reduces error due to frame torsional forces. I could always build a new mount and remove the table. The Zen is pretty flexible in that way, a good deal of the design can be up to you.

Monday, April 30, 2012

Bench PSU: AVR JTag update #4 (I think I can stick a fork in it now)

I've slowly but surely made progress on my bench power supply. I think my JTAG issues are a thing of the past. I've done a couple things to ensure reliable communications, and I've now got the AVR Dragon running at 2 MHz with 0 errors so far. First, I put the 20pf capacitor on the JTAG clock line, at the breadboard side. I know I derided the lowly 20pf cap in the past as a pawn of the Capacitor Cartels, but I'm eating crow now.

The second thing I did was to create a JTAG "Bread Head", so named in and inspired from this post on Blondihacks: Bread Head. I'm not a great photographer, and macro shots seem to be even harder, but here it goes:


My Atmel 644 (and pin compatible DIP 40s) JTAG
Breadboard adapter. I could probably trim a little more
perfboard off the top.

Tuesday, April 24, 2012

Bench PSU: AVR JTag update #3

In my last post, I reported that I got my AVR Dragon to work in a 5V circuit by creating what I called a "shielded JTAG cable":


I speculated that "cross talk" interference might have been causing my un-reliable JTAG when running my circuit at 5V. (It worked fine at 3.3V, but some components in my final circuit are 5V parts, I also noticed that many 20 Mhz AVRs are only rated to run at a full 20Mhz above about 4.5V)

I got my DSO Quad hobbyist class digital scope last week, and I was all set to write up a really scientific post documenting my construction and testing of a shielded AVR cable, then something strange happened. I switched to another 2x5 "unshielded" JTAG cable to reproduce my original problem. When I hooked up my DSO to the JTAG clock line, the programming functionality worked flawlessly at 5 Volts! Curse you, Heisenberg! (Yes, I know that this is not really the meaning of the Uncertainty Principle, but any time I run across a case where the act of measuring something alters the quantity I'm trying to measure, I think it it).

Saturday, April 21, 2012

Windows Installers - Having it your way.

Despite being my blog about "software and electronics", I've been sparse on posts about what's historically been my bread and butter - the Windows Desktop platform, still the best thing to happen to computing since sliced bread ... and butter. It's just not as sexy as the exotic embedded stuff or the mobile platform du jour.

Aynways I've been meaning to compile and post a list of windows tools that I think rock. I'm always surprised when I find out someone whos been using windows for a long time doesn't knwo about some particular tool I've been using forever and think is essential, "what, you mean you've never heard of SciTE?".

7-zip is definitely a tool in that category. It can open just about anything considered an "archive" format, zip, gzip, tar, rar, iso, and one that I find handy when something's gone wrong: msi and cabs.

I recently got my atmel cpld JTAG programmer, and wanted to install the AtmelISP software. For some reason only known to my PC, the installer refused to complete, and performed a lat minute cancel/rollback at the end of the install.

While the fail dialog was up, I used Sysinterals procmon (another rockin tool, by the way) to find out the installer wrote some temp files that happened to be "msi" (Microsoft installer packages). I copied the msi files and opened with 7zip, which allowed me to extract the atmel isp software. This worked in this case becasue there were no critical scripts run by the installer other that to install ftdi drivers, which I already had installed.


--P

Wednesday, April 18, 2012

Bench PSU: AVR JTag update #2 (it's alive!)

I think I figured out the noise issue on my ATmega setup.

After I posted my ATDH1150 teardown yesterday, I got to thinking about the "JTAG-X" port on the device:


It's a 2x7 JTAG port that looks to be wired to the same lines as the 2x5 "JTAG-A", except that one of the two rows is almost, if not all, connected to GND. I'd seen this done other ribbon cable type connections, but I never really thought much about why this was done. The effect of it is to make every other wire in the ribbon a GND line. I'm probably butchering terminology here, but I think this is a form of shielding. It helps to reduce electromagnetic interference, or cross-talk(is that the right term?) between the signal lines.

My experiments so far with my AVR Dragon-breadboard setup lead me to strongly suspect that noise was the culprit, and contrary to my initial intuition, many types of noise can become more of  problem with higher voltages.

Tuesday, April 17, 2012

ATDH1150USB mini tear down.

Last month I mentioned the ATDH1150USB Atmel CPLD JTAG programmer, and my efforts to home-brew my own programmer based on some ancient code I found on Atmel's website.

The escalating level of effort required to make my own programmer outweighed the $45 it cost to just buy the Atmel programmer. Slightly annoying, since I already own an Atmel branded JTAG device, the AVR Dragon.

There's scant information on the web about the 1150, unlike it's popular Altera cousin the "USB Blaster".

Here's the hardware that came in the box:

Box contents: mini USB cable, a loooong (I estimate 18") 2x5 JTAG ribbon cable,
and a 6" 'JTAG-X" 

The first thing I did was immediately void my warranty(does this thing even have one? I have no idea, I'm guessing that the folks at Atmel would be laid back if I ever ran into issues, this isn't a consumer device. )

Bench PSU: AVR JTag update

I did some more experimenting with my AVR Dragon JTAG woes today, despite not really having the time (I was supposed to file my taxes, but thanks to the District of Columbia, I get one more day. Why put off until tomorrow what you could easily do the day after tomorrow?

To summarize my last post:

ATmega 644 in a breadboard, JTAG functionality only seems to work reliably when powered at 3.3V vs 5V.

I was a little distraught that I had to spend time with dumb issues like this, and not on to cooler stuff. In building this power supply though, I'm sure that I'm going to face a lot of noise issues. I felt dumb.

Well, I'm an Engineer, and what do Engineers do when they feel dumb? They get empirical. Hypothesize, Measure, Test, Rinse, Repeat. Through process of elimination, I knew I could come up with a list of things that were not the cause of my problems. I made a list of random notes as I tried various things that might show a different behavior.

Monday, April 16, 2012

AVR JTAG programming oddities

I recently launched a new project, I'm working on a bench power supply. I've wanted to do the "old ATX PC PSU to bench power supply" thing for a while, and there was a recent series on the EEVBLOG whose design I'm taking a lot of inspiration from. (That David Jones is a freakin' genius). I want to have a little more "kapow" than his design, 0-9 V, 3 channels. I don't know if that's a folly on my part, but time will tell.

I finished up the "thinking a lot about it" phase, where I watch TV and daydream about what I want to do, and I moved into the prototype/experiment/pre-design phase.

I'm going to use an ATmega 644 as the main MCU to drive my logic. I'm wavering between that and the ATmega 328, but I just think the 328 probably doesn't have enough pins.

I've thrown together a few lines of code for doing the LCD display logic, using a "HD4478x" library for AVR's I found on the internet(I'll wait until my project is farther along before giving credit, since I might swap it out or roll my own in the end).

I went to test on a breadboard tonight and I discovered something very perplexing that I've not run into before...