Unexpected signal level on a pin

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I know this sounds a bit odd, but here it goes:

 - On PB6, which is an ADC input as well (and that is how I intend to use it) I get around 0,893 Volts in all cases, except when I don't start ADCs, set is an output and set level to 0.

 

This includes:

 - When I use it as ADC6

 - When I use it as a digital input in modes Totem poll, with or without Pull up and Pull down

 - When I set it as a digital output with High level

 - When I erase the firmware of the device and reset it

 

Some additional info:

 - ADC reading seem to correspond to that signal, I get about 3800 when using Vref 1V, single-ended (and considering the offset).

 - I use PDI, not JTAG (this pin is the JTAG TCK, but not in this case) and that's where I get the power from.

 - I've tested on several devices, so I rule out the possibility for a defect in the MCU.

 

The hardware dev department claims, that there is nothing connected to that pin, it goes to ground through 10K resistor. The circuit to that input pin is complicated, but supposingly unconnected on the test pcbs for firmware dev.

 

Any ideas?

This topic has a solution.
Last Edited: Fri. Jun 3, 2016 - 11:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Which model of Xmega? Remember that the ADCs in the first Xmega chips (especially xmega128A1) were seriously FUBAR!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

XMEGA 256 A3U, I will double check the errata, good idea.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

By the way this is very interesting material: http://blog.frankvh.com/2010/01/...

 

So, these problems are probably fixed in the U series and, more importantly, the general problem is not the ADC inaccuracy, but the unexpected signal on that pin even when ADC is off, even when firmware is erased :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am starting to thing that due to some PCB specifics or overvoltage on that pin the input is damaged and always acts as DO high level.

This happens to all test PCBs I have, I simply cannot control the pin - whatever I configure, there is always HIGH level there (3,150 when it is assumingly "connected to nothing").

 

Does that seem likely as a result as an overvoltage to that pin or something?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like a problem with what you have the pin connected to. Show us a schematic. Perhaps not the design schematic, but draw one by tracing out the board, just in case "As built" differs from "As drawn."

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Found it, it was the JTAG.

Switching JTAGEN fuse (Fusebyte 4, bit 0) to 1 (1 = jtag disabled) solved the problem, it seems that when it is enabled, there is an internal pull-up, which overrides or interferes a those pin functions - overrided the GPIO settings, but ADC sampling still worked, though it was the internal pull up, which was sampled.

 

Note that there was no actual JTAG conencted or interface for it on the PCB - just the fuse enabling.

Last Edited: Fri. Jun 3, 2016 - 11:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To add a protection for that happening in your application (in case you forget to switch off JTAGEN fuse), you can do the following (or simply use the two lines, setting the corresponding registers):

 

__inline void DisableJTAG(void)
{
    CPU_CCP = CCP_IOREG_gc;
    MCU.MCUCR = MCU_JTAGD_bm;
}

The same problem is described in this topic, where master theusch had the right idea quickly, but it is hard to search if you don't assume it is a JTAG problem:

https://www.avrfreaks.net/forum/x...

 

Note that your MCUs might come with JTAG enabled or disabled, according to what is discussed there (according to docu JTAG is enabled by default).