MQX 4.0 ADC demo does not work on KWIKSTIK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX 4.0 ADC demo does not work on KWIKSTIK

832 Views
anguel
Contributor V

Hi!

The ADC demo from MQX 4.0 runs fine in CW 10.3 for the TWR-K70 board. But when I run the demo with KWIKSTIK I get the following output in the CW console window (note: I have ommited some of the many blank lines inbetween):

-------------- Begin ADC example --------------

Opening ADC device ...done

Opening channel #1 ...done, prepared to start by trigger

Opening channel #2 ...done, one sequence started automatically

Triggering channel #1...triggered!

               ADC ch 2: 28819

             

Pausing channel #1...stopped!

             

                                                                         

Resuming channel #1...resumed!

             

             

Looks like for some reason the read() does not get the result...

Thanks in advance for any help!

Regards,

Anguel

0 Kudos
4 Replies

448 Views
c0170
Senior Contributor III

Hello anguel,

I have tested adc demo and had same result as you reported.

I suspected that it was going to be a problem with semihosting. Thus I disabled it (IODEBUG) and redirected output to another serial module, stepped it through the code, read was returning values. Can you test it with IODEBUG disabled?

Regards,

c0170

0 Kudos

448 Views
anguel
Contributor V

Martin,

Thank you for the feedback. Am I correct that when I disable the IODEBUG there is no way to see printf() output? Where do you exactly see the read in ADC values?

Regards,

Anguel

0 Kudos

448 Views
anguel
Contributor V

I now redirected output to TWR-SER RS232 and the ADC demo reads in values (at least until I halt the program with the debugger).

Now I tried to set the first adc0 channel from ADC0_SOURCE_ADPM0 to ADC0_SOURCE_AD10 which should be the microphone input on the kwikstik. The problem is that I always read the same value (approx 32000) even if I make some noise. What could be the reason?

BTW: The SD CARD demo also does not work with IODEBUG enabled on the KWIKSTIK. There seem to be some serious problems with the onboard J-Link debugger.

Anguel

0 Kudos

448 Views
c0170
Senior Contributor III

Hello anguel,

I haven't tested the microphone with ADC. I will have to look into this, but I am currently busy with one release. One thing I have not mentioned, there's file init_iodebug.c where is defined IODEBUG init structure.

const IODEBUG_INIT_STRUCT _bsp_iodebug_init = {

    IODEBUG_MODE_SEMIHOST,  /* Driver mode */

    127,                    /* Length of buffered data */

    '\n'                    /* Default flush character */

};

Have you tried to tweak at least length of buffered data? If you set it to 0, no buffer will be used.

I reported problems with IODEBUG and adc demo (potentionally with other drivers, I'll have a chat with IODEBUG developer who is currently away), this will be checked.

Regards,

c0170

0 Kudos