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.

high sampling rate

Other Parts Discussed in Thread: MSP430F5436A

Hi,

I am using msp430f5436a for a university project.

My code is based on TI's user experience example.

I changed the system clock from 16 Mhz to 25Mhz because I wanted to sample audio input in 16Kbs frequency.

2 things have happend:

a. a high rate of the samples get screwed up- there are alot of zeroz

b. The board sometimes get stuck in the function "halBoardSetSystemClock(SYSCLK_25MHZ)" and dose not proceed.

Dose anyone have any Idea why these things are happening?

Thanks

Ariel

  • Ariel,

    To operate at 25MHz, the PMMCORE value must be set to 3.  If this value is 3, is the supply voltage to the part at least 2.4V?  The ADC requires at least 2.2V for proper operation and a PMMCORE value of 3 requires at least 2.4V to operate properly.

    Regards,

    Jim

     

  • Besides the requirements for running the MSP on 25MHz, there is no need to do so.

    For 16KHz audio sampling, you need 32ks/s 12 bit conversion takes 13 clock cycles, so there's plenty of time for the ADC to sample the data when clocked with its internal 5MHz (even 400kHz would be enough for this job).

    Also, you have 31µs between two samples, which is, at 16MHz, 496MCLK cycles per sample. This is way enough to do anything you want. Unless you're too stupid to write fairly efficient code (which I won't assume here).

    You can go even further and use the DMA controller to transfer groups of samples (e.g. 128 or 256 samples each chunk or even more) from the ADC12MEM reult register to a ram buffer. This will trigger an interrupt every 4ms (for 128 samples) and requires you to switch the DMA over to a second buffer within 31µs, and then continue processing the collected samples in a row. e.g. setting them up for an SD card write, stuffing them into an UART output buffer (well, this could be a bit difficult as it would require 512kBaud minimum transfer rate) or whatever you're sampling the data for.

    4ms is an eternity.

    I'm sure I could do the job with 4MHz system clock without running into timing problems, Including writing the data as a byte stream to an SD card (no file system)

  • Thank you mister, for re-planning my project,

    Your answer is arrogant and patronizing and better was not writtern at all!

    Also, you can obviously see that two weeks have passed since I posted my question, so your answer is not relevant.

    Unless you are too stupid to read a date (which I won't assume here)  

  • ariel said:
    Thank you mister, for re-planning my project,

    I didn't intend to re-plan your project, only to re-adjust your poitn of view. You're not the only one asking for more speed because the code was unnecessarily slow. The main statement was that ther eis no need to go for 25MHz and even 16MHz are more than plenty for this task. If not, then there must be something significantly wrong with the code design in general (such as doing float divisions where an integer shift would do the same - just out of of PC programming habit.)
    Apparently I failed in bringing you this near.

    ariel said:
    Your answer is arrogant and patronizing and better was not writtern at all!

    Arrogant? not really. Perhaps self-confident. Patronizing? Well, I had the impression that you'll need some guidance. Thats usually why people are coming here and asking questions. If you didn't, well, why did you come here?

    ariel said:
    Also, you can obviously see that two weeks have passed since I posted my question,

    Well, 9 days are not two weeks. Not even if I round it.
    And normally people are happy if they get an answer after some days. Or they write they have solved the problem on their own. Or mark an existing answer as verified if it solved the problem. Or thank the one who answered.
    If you don't want an answer that's not immediately posted after you asked, call the paid support, but don't ask in a community.

    Sorry for your inconvenience of having to learn about an aswer that is given not the moment you asked. I fI hadn't been incapacitated for the last two weeks, I had answered you earlier. Still it would have been the same content.

    ariel said:
    so your answer is not relevant

    Relevance is based on content, not on time. My answer might habe been obsolete (but you didn't mark you case closed not write anythign that could give this impression), but not irrelevant. Sorry for wasting my time to write something that was intended to help you.

    ariel said:
    Unless you are too stupid to read a date (which I won't assume here)

    To throw the ball back: 9 days = 2 weeks, well, this allows for some unbiased judging about math skills. No assumption here, plain mathematical facts.

    You shouldn't ask if you don't like the answers. And if you'll only accept an answer you want to hear, there's no need to ask too. Or ask a multiple-choice question.

  • It is very revealing of a person's character when they put so much effort into insulting someone who has just given them excellent advice.  Calling a person stupid, especially a person who by all accounts and purposes is an expert in the subject for which you obviously are clueless about, is a good way of displaying to the world what type of person you are, and what level of competence you possess.

    Good response Mr. Gross, and good luck to you Ariel, you have got a lot of learning to do.

  • One thing has to be made clear here, I have never called anyone stupid! Not anyone that has asked for my help, and especially not anyone who offered me assistance.

    These are his words, definitly not mine. ("Unless you're too stupid to write fairly efficient code"), this is the sentence that made me angry.

    So if anyones's character was "revealed" here it is his, not mine.

    I don't intend to start a long and tidious discussion here, I think I made my point.

    I hope next time Mr Gross offers his help, he will do so like the rest of the guys here. With a little sence of patience and respect. Even if the person asking has less knowledge than him.

    I will keep my answer short since I can see Mr Gross has a habbit of writing biblical commentaries on what I write :)

    Good luck to you too Mr "sparkchaser", and have a good week

    Ariel

     

  • Point taken.

  • ariel said:
    These are his words, definitly not mine. ("Unless you're too stupid to write fairly efficient code"), this is the sentence that made me angry.

    If you quote, please quote correctly and complete:

    "Unless you're too stupid to write fairly efficient code (which I won't assume here)."

    Which clearly states that I didn't assume nor wanted to express that you are too stupid but rather that this is the only obvious reason to have it not working with the available power, so you should be able to do it. Of course if you want to put these shoes on you, I cannot help you (and this rather shows your estimation of the situation than mine).

    Maybe my selection of words wasn't appreciated by you but it was no insult nor was it intended to be one. Sorry if It hit a sensible point in your own estimation of your skills.

    ariel said:
    I will keep my answer short since I can see Mr Gross has a habbit of writing biblical commentaries on what I write :)

    As we can see, not even a biblical commentary can prevent misunderstandings. Even less (too) short sentences - or quotes.

**Attention** This is a public forum