USART SPI Problem

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

Hi,

 

I'm using my A3BU's USARTE0 in MSPIM, and I've come across a weird issue.

I have it connected to an external ADC, and I'm aiming to read voltages from 0-3.3V, along with tag bits to show which channel it's connected to, and reading the data back on an LCD.

 

The weird thing is that it works fine from about 0 to 2.04V, and then after that, it gives weird numbers like the wrong channel tag (like 7, 6, and 4 instead of 3), and inaccurate voltage readings, like a maximum value of 3.8V at the top of the pot, and it actually freezes after about 10 samples (reads Channel 6, 0V). I know it's not the ADC, because when I connect it to the normal SPI on Port C, it gives smooth, accurate voltage readings with the correct channel tag throughout. 

 

Just having a tough time debugging this. It shouldn't be clock polarity, or baud rate if it works up to a certain voltage input? 

This topic has a solution.
Last Edited: Fri. Aug 25, 2017 - 01:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good GND between uC and ADC?

David (aka frog_jr)

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

Show circuit schematic and small complete program that demos the problem, please.

 

Jim

 

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

Apparently not, adding more ground connections has it switching channel tags a lot less, and it doesn't go as high in voltage.

On a breadboard, I have all the analog grounds on one side, and the digital grounds on another side (opposite rail), and then at one point on the breadboard I bridge them together. Is this an okay practice?

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

Breadboard connections can be flaky. Especially working with analog.

Having the single point GND between analog and digital is a (generally) good practice.

Are all VCC and GNDs connected on the uC and ADC?

David (aka frog_jr)

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

ki0bk, I will do that

Breadboard connections can be flaky. Especially working with analog.

Having the single point GND between analog and digital is a (generally) good practice.

Are all VCC and GNDs connected on the uC and ADC?

Okay thanks.

Not all are connected (I've added more, but don't have enough jumpers atm), but strangely, using the normal SPI, they didn't have to be, yet with the USART MSPIM they make a difference. Is this just the way the PCB of the Xplained board has been designed, or is there another reason as to why?

Last Edited: Thu. Aug 24, 2017 - 09:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've attached a schematic of the external ADC.. a TI ADS8332.

 

Not all the grounds should need to be connected right?

 

(And a schematic of the 256A3BU Xplained board)

Attachment(s): 

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

Ah ok, I fixed it.

The ADS8332 needs a digital voltage supply of either 3.3V, or 5.0V. Depending on which you choose, you configure a jumper on the board.

The datasheet makes it seem like it's optional between either or, and it seemed that way, since on the normal SPI 3.3V for the Vd worked fine.

As it turns out, for USART MSPIM, you need 5V, otherwise you get the weird behaviour I got.

 

Thanks the help. I attached a picture of the ADS8332 datasheet where it shows that ambiguous (at least to me) power requirement

Attachment(s): 

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

You seem to be confusing the the requirements of the ADS8332 chip itself with the requirements of the particular board you have it on

 

The image you provided:

 

 

is not from the chip datasheet: http://www.ti.com/lit/ds/symlink/ads8331.pdf

 

So, presumably, it relates to some specific board?

 

So what board are you actually using the ADS8332 chip on?

 

BTW: note how much easier it is to follow when you put the image in the post - rather than just attaching it.

Instructions here: http://www.avrfreaks.net/comment...

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

Sorry, I interchange 'chip' and 'board' a lot. (Sounds good, I'll insert the images next time.)

There are two ADS8332 evaluation board versions, and I'm using the first. This is the user guide and the power requirements are on Page 5.

 

Last Edited: Fri. Aug 25, 2017 - 08:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Xmega are 3.3V chips? Why would you want to connect 5V?

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

The external ADC board is what needs the 5V digital power.. as for why, instead of 3.3V which the evaluation board user guide says is ok, I don't know. I'm using the 5V pin that the Xmega256A3BU has to supply that

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

The chip datasheet does show performance differences between 3V and 5V.

 

The eval board might have similar and/or other dependencies ...