This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Setting Up SD16 on MSP430F4270 Device

Other Parts Discussed in Thread: OPA333, MSP-TS430DL48

I am well versed in setting up the SD16 on the F2013 uC. The same strategy does not seem to work on the F4270, therefore I need some clarification on the proper method to set up the ports.

 

What is known:

a) There are a total of 4 differential inputs on P1.x identified as A2-A4 which are selected by the SD16INChx bits. Therefore to select the A4 channel the following setting is made:

 

SD16INCTL0 |= SD16INCH_4 /* SD16 Input Channel select A4 */(Note in this case input pair on P1.2 and P1.3)

 

b) The SD16 inputs are distributed between ports P1.x and P6.x.

 

For P1.2-P1.7 are listed on datasheet pages 40-44 and are activated by SD16AEx.

For P6.0-P6.3 are listed on datasheet pages 50-51 and are activated by P6SELx.

 

Comment 1) what is gleaned from above is that just P1.x ports are the only ports that can access an internal ground to Vss--I assume this unless otherwise instructed.

 

b) Thus, to set up a P1.x port for a read, one must use SD16AEx

The header file lists the following:

/* SD16AE */

#define SD16AE0 (0x0001) /* SD16 External Input Enable 0 */

#define SD16AE1 (0x0002) /* SD16 External Input Enable 1 */

#define SD16AE2 (0x0004) /* SD16 External Input Enable 2 */

#define SD16AE3 (0x0008) /* SD16 External Input Enable 3 */

#define SD16AE4 (0x0010) /* SD16 External Input Enable 4 */

#define SD16AE5 (0x0020) /* SD16 External Input Enable 5 */

#define SD16AE6 (0x0040) /* SD16 External Input Enable 6 */

#define SD16AE7 (0x0080) /* SD16 External Input Enable 7 */

 

Question 1) It is not clear how SD16AEx relates to the exact port to select. For example, to select the P1.3 as A4+ input, with P1.2 free to be a GPIO, therefore A4- is internally grounded to Vss. It seems logical that one would select SD16AE6, or is it SD16AE1 ?, there are too many variables here to experiment with, can someone that actually has set up the F4270 device share their knowledge?

 

Comment 2)

a) I have set SD16AE to both 0x00 (should not read at all!), and 0xFF, and most permutations in between, and the reading is always the same in the SD16MEM register (about 4.7mV low at input of 0.2965VDC).  This is confusing and indicates that something is wrong, I have attempted a different uC.

b) If I alter the input the error is proportional to the change of voltage on the input (thus, SD16 is reading, but not correct).

c) By checking the offset (offset binary mode), it is very small thus error is not here. By reading Vref, SD16MEM=0xFFFF, appears not to be gain error.

d) By reading the ground of the input voltage, there is some error, but not enough to account for the error of the incorrect reading.

d) I have attempted to do both single and continuous reads with similar results.

 

Here is my initiation:

SD16CTL = SD16REFON + SD16SSEL_2;

SD16CCTL0 = SD16UNI + SD16SC;

SD16INCTL0 = SD16INCH_4;

SD16AE = SD16AE6;

SD16CCTL0 |= SD16SC + SD16IE;// the interrupt is activated for a read by the WDT in interval mode at one second interval mode (thus for a single read, lots of time for the cap to charge in the SD16) and interrupt disabled after read of SD16MEM in the SD16 ISR.

Hope to get some good help here :)

 

  • MAC Engineering said:
    It is not clear how SD16AEx relates to the exact port to select.

    Actually, it does not select a port, it prepares a port pin for exclusive ADC usage (so the digital I/O doesn't interfere). The same bit applies to different analog inpots if they are connected with the same physical pin.
    You'll find the information which bit controls which pin in the pin logic part of the datasheet.

    MAC Engineering said:
    I have set SD16AE to both 0x00 (should not read at all!), and 0xFF, and most permutations in between, and the reading is always the same in the SD16MEM register (about 4.7mV low at input of 0.2965VDC).  This is confusing and indicates that something is wrong,

    No, it just means that your signal source has a low enough impedance so that the parasitic digital input/output circuitry does not influence the signal. However, if you had programmed one of the port pins as output, you'd have seen a difference :)

    MAC Engineering said:
    If I alter the input the error is proportional to the change of voltage on the input (thus, SD16 is reading, but not correct).

    This may be the influence of the digital port logic, then. At least it sounds likely :)
    Around the trigger oltage, the leakage current of CMOS inputs greatly increases form a few pA to several to many µA. That's why the AEx bits disable it completely.
    Thsi unlinear increased current causes a nonlinear deformation of the conversion curve.

  • Jens-Michael Gross wrote: The same bit applies to different analog inpots if they are connected with the same physical pin.


    I do not understand this comment, I am aware English is not you native language.

    Jens-Michael Gross wrote:  You'll find the information which bit controls which pin in the pin logic part of the datasheet.


    This is true, I listed the pages of the data-sheet in my post.  Jens-Michael Gross information based on the assumption that one does not know where to find the information.  The information as I outlined in my comments is not clear, this is why I choose to use E2E to find someone with experience or helpful information to relate SD16AEx to the particular port as outlined in my comments.

    Jens-Michael Gross wrote: No, it just means that your signal source has a low enough impedance so that the parasitic digital input/output circuitry does not influence the signal.

    There is an OPA333 follower conditioning the signal to the SD16 input, it appears that you did not understand that the data-sheet states that by activation of SD16AEx the GPIO is to be disabled. Thus, data-sheet page 28, SD16 input impedance for gain of 1 is 200kohm. In addition, the SD16 is not reading the signal measured at the input, thus the port is not dragging the signal down.

    Jens-Michael Gross wrote: However, if you had programmed one of the port pins as output, you'd have seen a difference :)

    "?one of the port pins as an output?" This is not helpful because there are ports P1.0 through P6.7, thus any port will due?  Now, if you are saying to configure the particular port as an output that is used by the SD16, you would have to reference the data-sheet, say for P1.3 on page 42, thus P1DIR is disabled, therefore either I do not understand what you are saying, or what you are saying is not informed by the data-sheet reference.

    Comment:  I set P1DIR = 0xF7 so that all unused ports are outputs with the exception of P1.3 as suggested by the User Guide if this is what you are trying to get at?

    Jens-Michael Gross wrote: This may be the influence of the digital port logic, then. At least it sounds likely :)

    This is not informative nor helpful.  Then your next comment seems a contradiction to the comment above, but the next comment is informed.

    Jens-Michael Gross wrote: Around the trigger oltage, the leakage current of CMOS inputs greatly increases form a few pA to several to many µA. That's why the AEx bits disable it completely.

    Yes, this is known (assuming 'it" is the port under consideration)

    Jens-Michael Gross wrote: Thsi unlinear increased current causes a nonlinear deformation of the conversion curve.


    Ah, the SD16 has a second or possibly a 3 order transfer function?  Where is this mentioned in the User Guide or data-sheet?  Please expand on this comment, the SD16 in the F2013 device is a linear relation between the input voltage to the bits stored in SD16MEM variable.  If this is my error, please do direct me to the proper transfer function.

     

    I spent a great deal of time attempting to write an informative description of my problem and what I was looking for.  I also spent a great deal of time responding to the previous post.  True, by reading the posts in the E2E, there are people that make simple mistakes by not reading, or possibly not understanding the data-sheet or User Guide.  We know how clear some of these documents are :)  Humbly, I make my share of mistakes by overlooking information that is in front of me.  Sure, I need help also, but one can not assume that people that write into E2E do not read the data-sheet nor the User Guide.  My last resort is E2E, and I need the participants to understand my comments enough to recognize that I am seeking information that produces results and answers my questions as stated.  I could not have obtained field results with the F2013 otherwise.

    Could I have a TI  representative respond to my question, or please read my question and respond to what I am asking, if what I am asking is not clear, please do ask for clarification.  If I put references into my post, please go read them and you will understand that I have read this information, therefore we are on the same page ( I mean the same page!).

     

    Thanks for you valuable time! !!!!!!!!!!!!!!!!!!!!!!!!!!!! My time is for profit and edification, not social networking.  I seek the natural world for fun and enjoyment.




     

  • MAC Engineering said:
    Jens-Michael Gross wrote: The same bit applies to different analog inpots if they are connected with the same physical pin.

    I do not understand this comment, I am aware English is not you native language.

    Sometimes, language issues lead to misunderstandings, This time, however, I exactly meant what I wrote (except for the o/u typo):
    On some MSPs, one physical port pin belongs to several logical analog signals, e.g. A4+ and A2-. The same AEx bit applies to both inputs. AE2 does not apply to A2+ and A2- but to one or more analog inputs that are attached to a certain physical pin. There is no fixed relation between the AE bit number and the (logical) analog channel.

    MAC Engineering said:
    Jens-Michael Gross information based on the assumption that one does not know where to find the information.

    This is an Engineer-to engineer forum (hence the name "e2e") However, many people coming here do not know where to look, including otherwise experienced ingenieurs. And even if they look at the right points, they sometimes simply do not see the detail that tells them that they were looking at the right place.

    MAC Engineering said:
    it appears that you did not understand that the data-sheet states that by activation of SD16AEx the GPIO is to be disabled.

    I very well know this. I wanted to express that it is not necessary to deactivate the digital I/O to use the pin as analog input. It is not an either-or, it is an always analog and decativatable digital.

    MAC Engineering said:
    "?one of the port pins as an output?"

    Ypou said that you'r enot seeing any difference whether you set the AE bits or not. My sugestion was to set one of the port pins (the one you are sampling on the SD16) to output and you'll definitely see a difference between the AE bit being set or not. This also can be used to confirm which AE bit works on which port pin/analog input.

    MAC Engineering said:
    There is an OPA333 follower conditioning the signal to the SD16 input,

    My crystal orb was not showing me this. Sorry, I need a better one.

    MAC Engineering said:
    the SD16 is not reading the signal measured at the input, thus the port is not dragging the signal down.

    If (and only if) the proper AE bit is set, this is right. However, there is no mechanical switch breaking the connection between analog and digital part, so even a digital separation is not completely without influence. Anyway, the port can even pull it up. And without knowing that you have an OPA follower, this can very well be in a range that affects the signal and therefore the reading.

    MAC Engineering said:
    Jens-Michael Gross wrote: Around the trigger oltage, the leakage current of CMOS inputs greatly increases form a few pA to several to many µA.

    Yes, this is known

    You'd be surprised how many people (including the majority of the ones coing here) do NOT know this (and how many do not even know that the MSP uses CMOS technology), and even do not care (until explicitely told that this indeed affects their application).

    MAC Engineering said:
    Ah, the SD16 has a second or possibly a 3 order transfer function?

    No, but the overlap of the SD16 with the (nonlinear) leakage current of a non-deactivated CMOS input very well forms a higher-order result. This is why there are the AE bits at all. Which do not seem to make any difference, according to your words.

    MAC Engineering said:
    I spent a great deal of time attempting to write an informative description of my problem and what I was looking for.

    Yes. But also, I work from the simple assumption that if what you think what's important and descriptive to your problem will lead to a solution, then you should have found the solution yourself already. It often is what you do NOT write that cause the problem. And since you do not write it (because you do not think of it), I can only guess or try to deduct what might be the cause.

    I do not have your hardware on my table, I do not have your source code or your test signal. All I know is that the things you thought of mentionign them are likely not the ones causing the problem. Unless you posted an obvious mistake.

    On the bottom line, your initial post sonded like 'I know that everything is okay, so why is the patient dead?". The only obvious answer is "because not everything is okay or the patient is not dead".

    MAC Engineering said:
    We know how clear some of these documents are :)

    I completely agree. However, sometimes is it just a question of interpreting the data in the right way. or understanding how the writer has organized or categorized it. Sometimes this is difficult and a lack of experience with this or that particular style hides the wanted information.

    MAC Engineering said:
    one can not assume that people that write into E2E do not read the data-sheet nor the User Guide

    You'd be surprised. There are some who didn't notice that there actually are two different documents. And did indeed read the one they had carefully, without finding the wanted information.

    MAC Engineering said:
    I need the participants to understand my comments enough to recognize that I am seeking information that produces results and answers my questions as stated

    I found only one question, and I thought I answered in a way that would lead to a deeper understanding:

    Question 1) It is not clear how SD16AEx relates to the exact port to select. For example, to select the P1.3 as A4+ input, with P1.2 free to be a GPIO, therefore A4- is internally grounded to Vss. It seems logical that one would select SD16AE6, or is it SD16AE1 ?

    The direct answer to this question as stated is: No. Was it helpful? I don't think so, so I didn't give you this answer in my last post. :)
    To expand it a little: SD16AE6 isn't it ether.

    So the extended long version: the notation 'SD16AE.x' in the port pin schematic, along with the notations of 'P1SEL.x' and 'P1IN.x' etc. makes it very likely, that '.x' refers to the physical port pin, no matter which logical analog input is connected to it. So SD16AE2 is for P1.2, SD16AE3 is for P1.3 etc. (I must admit, for P1.0/P1.1 half of the pad logic doesn't make sense on the 42x0 datasheet, and SD16AE.0/1 are not used at all on these chips)
    That's what I referring to in my very first sentence of my previous post.

    So if you want to sample on channel A4 and want A4+ undisturbed, you'll have to set SD16AE3, as A4+ is on P1.3.  If you don't set SD16AE2, then A4- is set to VSS, if you do, it is taken from P1.2, which will be (if otherwise unconnected) fed by leakage current and/or radio waves. Or crosstalk from P1.3 (which is another possible explanation for the nonlinear behavior)

    A0/1- are never connected to VSS but always to P6.1/6.3. So SD16AE.x is not needed for selecting VSS or pin for these negative inputs. P6SEL is used to deactivate the input in this case, as these pins do not have a digital module usage, so no AE bit is required as a secondary PxSEL bit.

    It's a often-made experience (not only for e2e, but also for astrologers, psychic or medical doctors or fortune-tellers) that the answers people ask for are not the answers the people need or want. The difficulty is to find out which questions they should have asked instead, and answering these.

    It's not an exact science. Sorry.

  • OK, here is the answer to my initial question:

    SD16AE2: P1.2 (A4-)

    SD16AE3: P1.3 (A4+)

    SD16AE4: P1.4 (A3-)

    SD16AE5: P1.5 (A4+)

    SD16AE6: P1.5 (A2-)

    SD16AE7: P1.7 (A2+)

    Thus , I have the inputs sorted out .  I am still not able to get an accurate reading though.

    Again, I need someone with hands on experience. 

    FYI, I am using the MSP-TS430DL48 target board. I placed a 22ohm resistor in the R12 location. I placed a 10uF(t) and 0.1uF(c) on the AVcc side of the resistor. This improved the power supply noise, but did not fix the problem.

    Question 1) It may be possible that the problem is in the JTAG interface? I was able to read excellent results out of the SD16MEM variable with CCS on the F2013 device. The F2013 has a Spi Bi-Wire interface. It is possible that due to the difference in packages or the FET I am getting this large error? Is there someone out there that has experience with the two interfaces and the SD16?

     

    Question 2) Can I get accurate readings from a single wire input to the SD16 on the F4270 device? The F2013 did very well.

     

    Question 3) Am I correct, only the P1.x ports support the single wire input for SD16? When these ports are used in the single wire mode, by grounding and floating the corresponding SD16 (Ax-) port I get different SD16MEM values (configured as outputs).

     

    FYI, I am using the MSP-TS430DL48 target board. I placed a 22ohm resistor in the R12 location. I placed a 10uF(t) and 0.1uF(c) on the Avcc side of the resistor. This improved the power supply noise, but did not fix the problem. Power supply is 3.3V TI regulator that has always preformed very well.

  • MAC Engineering said:
    OK, here is the answer to my initial question:

    You didn't read my last post, did you?
    it's what I described in teh very first post and explaind long and wide in my last. However, glad you found it out by yourself.


    MAC Engineering said:
    It may be possible that the problem is in the JTAG interface? I was able to read excellent results out of the SD16MEM variable with CCS on the F2013 device. The F2013 has a Spi Bi-Wire interface.
    No. SBW is a 3-phase serial to 1-phase parallel conversion that ends up at the very same parallel JTAG internally. If there is is any influence, it will rather be larger with SBW due to the increased frequency and the constant change of I/O direction.
    Also, on the 4270, teh JTAG pins are far away from teh analog inputs, so there is not a big chance of crosstalk.

    MAC Engineering said:
    Can I get accurate readings from a single wire input to the SD16 on the F4270 device?

    Can you? There have been no rumours of this chip performing significantly worse than others. The silicon for the SD16A is more or less the same in both. That's why it is called SD16A in both devices.

    I know that these answers are not really helpful, but what do you expect? Someone from TI popping up saying 'oh, yes, we know, this device is crap and we always knew but til now we didn't tell anyone'? So either it is crap and you won't get an answer or it isn't and the problem is somewhere else.

    MAC Engineering said:
    Am I correct, only the P1.x ports support the single wire input for SD16?

    You are. The datasheet does not let any room for doubts here. And I also answered this in the previous post.

    MAC Engineering said:
    When these ports are used in the single wire mode, by grounding and floating the corresponding SD16 (Ax-) port I get different SD16MEM values (configured as outputs)

    As it is to be expected with this pin circutitry.

    MAC Engineering said:
    I placed a 22ohm resistor in the R12 location. I placed a 10uF(t) and 0.1uF(c) on the Avcc side of the resistor.

    That's a good way which I did recommend several times in previous posts. The value for the resistor depends on what you do/ how much current is drawn from the analog part. I recommend 10 to 100 Ohm. 10 if you output the internal reference or use the DAC (if any) and much if you use an external reference and only take a sample every now and then.

    MAC Engineering said:
    Power supply is 3.3V TI regulator that has always preformed very well.

    individual parts may fail now and then. But I guess you checked with a scope. Just to be sure.

    So, office hours are over... goodnight everyone :)

  • Response to my post 15 jun 2011 2:00 PM

    Answer to Question 1:

    The JTAG interface does introduce noise into the signal seen by the SD16. The JTAG needs to be disconnected before testing the MSP for accuracy of reading by the SD16 ADC. I am sending out the value seen by the SD16 via RS-232 so that the debugger is not connected.

     

    Answer to Question 2: Problem still is that the SD16 is not preforming according to data-sheet specifications. I can not answer question 2 because it will not work with differential input, therefore why try single input?

     

    Comment, I will get back to E2E after the TI engineer confirms my results and the SD16 performance in this particular MSP.

     

    Love it! -- I answer all my own questions :-0 so far

  • Response to my post 15 jun 2011 2:00 PM

    Answer to Question 1:

    The JTAG interface does introduce noise into the signal seen by the SD16. The JTAG needs to be disconnected before testing the MSP for accuracy of reading by the SD16 ADC. I am sending out the value seen by the SD16 via RS-232 so that the debugger is not connected.


    Answer to Question 2: Problem still is that the SD16 is not preforming according to data-sheet specifications. I can not answer question 2 because it will not work with differential input, therefore why try single input?


    Comment, I will get back to E2E after the TI engineer confirms my results and the SD16 performance in this particular MSP.


    Love it! -- I answer all my own questions :-0 so far

  •   Contrary to popular myth all SD16s are not created equal.

     

    The answer to my original posting regarding a single ended input to the SD16, as opposed to a differential input is as follows:

     

    The F4270 family of devices SD16 ONLY READS IN DIFFERENTIAL MODE

**Attention** This is a public forum