2
\$\begingroup\$

Well, I'm officially stumped (and so are several other engineers)...

I have a custom PCB running an Atmel ATSAML21E18B microcontroller, which I'm trying to program through an Atmel ICE debugger / programmer. After some initial problems with the board (an ungrounded pin which has now been grounded), I managed to get a nice stable voltage of 3.3v running through the board from 3 AA batteries going through an LDO on the board.

The next step was to upload a simple test program which blinked a couple of LEDs on the board to make sure things were all nice and working. I plug the board into the Atmel ICE via a 10 pin SWD header on the board, open the device programmer in Atmel Studio and do a voltage read - 3.3v as expected. Try to get the device ID, and I get the following error:

Atmel Studio Programming Error

I've tried knocking down the SWD clock to lower frequencies as suggested by a few people, but no luck. I also tried using the Atmel ICE on the L21 Xplained Pro board, and everything works fine there, so I know that the programmer isn't the issue.

I've had a few other engineers look at the boards and the schematics, and they can see no obvious errors. We all checked the datasheet to make sure that the connection between the mcu and the 10 pin header was as described in the datasheet.

Honestly, I have no idea what's going on here. Below is a copy of the schematic:

enter image description here

If anybody here has even the slightest inkling of what the issue might be, please tell me. My head hurts from banging it against the desk!

\$\endgroup\$
  • \$\begingroup\$ I don't have time to do a full review, but assuming your design now has no bugs, one possibility fits the data presented so far: After that initial power-related problem, have you confirmed the MCU IC itself is still undamaged and if so, how? Or, have you got another MCU chip of the same type, on a different physical PCB (with the power problem corrected) which has never been powered-on with the original power-related mistake, that you can try? I don't think that specific MCU model has a preinstalled bootloader, so unfortunately if I'm correct, trying that as a test isn't an option :-( \$\endgroup\$ – SamGibson Jan 25 '17 at 22:12
2
\$\begingroup\$

As it turns out, on the 32 pin variant of the SAML21, you have to tie VDDANA to the power supply as well (with a decoupling cap in place obvs).

Got around it by soldering a bit of wire from the VDDANA pin to an exposed power pin on the first batch of boards. Got it rectified properly on the second set.

Note to self: read the datasheet properly next time!

\$\endgroup\$
  • 1
    \$\begingroup\$ Thanks for updating this topic with the actual fix (+1). The same situation applies to many MCUs - what might appear (by its naming) to be an analog supply pin, actually supplies other parts of the MCU as well and should not be left unpowered. As you say, the requirements should be in the datasheet. Glad you could fix your first batch of boards :-) \$\endgroup\$ – SamGibson Jun 22 '17 at 10:56
0
\$\begingroup\$
  • Try adding a cap (1µ) to the VDDCORE pin. The datasheet says that this pin is the output of the internal regulator. Worth a try.

  • Which package do you use. If it's the QFN type, did you solder the bottom pad to GND?

  • Measure VDDCore, what is it's value.

  • Double-check the SWDIO SWDCLK pins, monitor them using a scope to see if they reach their intended levels. Can you confirm no shorts between power/GND and those signals?

\$\endgroup\$
-1
\$\begingroup\$

Try removing R1 (its not needed), that pullup resistance doesn't seem large enough, especially since thats a very sensitive clk line running at 2-4Mhz by default. Man thats a lot of current for your clk line to source when it goes low which may have damaged the debugger. So make sure you can still read the device ID of the SAML21 Xplained Pro board.

Below are images of the SAML21 Xplained Pro schematic found in a zip here, which oddly was linked only in there User Guide PDF which I found in a google search for that boards schematics (Just to make sure). So moral of the story reference other open source designs and remember GIYF, before pounding your head on the desk...

[![enter image description here][1]][1] enter image description here

\$\endgroup\$
  • \$\begingroup\$ @Tom L. So you believe that 1k pullup is completely fine? smh, let the goose chase begin... p.s. thanks for the down vote. \$\endgroup\$ – nimig18 Jun 21 '17 at 4:17
  • \$\begingroup\$ That wasn't my downvote; yet, the Pull-Up is also in the schematic checklist. \$\endgroup\$ – Tom L. Jun 21 '17 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.