<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MQX Software SolutionsのトピックHelp with ADC</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Help-with-ADC/m-p/218330#M5663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i got a problem with the M52259DEMO board, i can't intialiaze the ADC, and is not a coding problem, it doesn't matter if i use the example config nor a custom configuration; the ADC does'nt start.&lt;/P&gt;&lt;P&gt;In the Debug mode i was able to track down&amp;nbsp; the failure in the _io_fopen function; there it seems that the MQX kernel just detects two devices in the IO_DEVICES struct listed here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
static FILE_PTR  fd_adc, fd_ch = NULL;    //Apuntadores para el ADC y para el Canal del ADCconst ADC_INIT_STRUCT adc_init = {    ADC_RESOLUTION_DEFAULT,     /* resolucion del ADC*/};const ADC_INIT_CHANNEL_STRUCT adc_ch_param = {    ADC_SOURCE_AN0,    //Configura lo que se va a leer     ADC_CHANNEL_MEASURE_LOOP | ADC_CHANNEL_START_NOW,    10,            /* numero de muestras en una secuencia */    0,             /* Offset de tiempo desde el trigger en ns */    50000,         /* perioso en us (50ms) */    0x10000,       /* Rango de escala del resultado (no usado) */    1,             /* Tamaño del buffer circular (sample count) */    ADC_TRIGGER_1  /* ID del trigger logico que inicia este canal del ADC */};/* *  Configurar ADC para que lea los valores en potenciometro y acelerometro */   void InitADC(void) {    fd_adc = fopen("adc:", (const char*)&amp;amp;adc_init);    if (NULL == fd_adc)     {            printf("\nFallo la inicializacion del ADC\n");        return;     }        fd_ch = fopen("adc:0", (const char*)&amp;amp;adc_ch_param);    if (fd_ch == NULL)     {            printf("\nadc:0 Error al abrir el canal del ADC\n");        return;    }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The IO_DEVICE struct that i've found in the Kernel_data in _io_fopen is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
IO_DEVICE --address:     0x00000000   Identifier:  "/" --address:     0x20000A78   Identifier:  "ttya:" --address:     0x20000C10   Identifer:   "gpio:" --address:     0x20000330   Identifier:  "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&amp;nbsp;and that's all the devices, so when i try to access the "adc:" returns error because the function did't found such device. Any idea about how can i initialiaze the ADC? Thanks in advance.&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Sep 2009 05:20:43 GMT</pubDate>
    <dc:creator>Jairo</dc:creator>
    <dc:date>2009-09-27T05:20:43Z</dc:date>
    <item>
      <title>Help with ADC</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Help-with-ADC/m-p/218330#M5663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i got a problem with the M52259DEMO board, i can't intialiaze the ADC, and is not a coding problem, it doesn't matter if i use the example config nor a custom configuration; the ADC does'nt start.&lt;/P&gt;&lt;P&gt;In the Debug mode i was able to track down&amp;nbsp; the failure in the _io_fopen function; there it seems that the MQX kernel just detects two devices in the IO_DEVICES struct listed here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
static FILE_PTR  fd_adc, fd_ch = NULL;    //Apuntadores para el ADC y para el Canal del ADCconst ADC_INIT_STRUCT adc_init = {    ADC_RESOLUTION_DEFAULT,     /* resolucion del ADC*/};const ADC_INIT_CHANNEL_STRUCT adc_ch_param = {    ADC_SOURCE_AN0,    //Configura lo que se va a leer     ADC_CHANNEL_MEASURE_LOOP | ADC_CHANNEL_START_NOW,    10,            /* numero de muestras en una secuencia */    0,             /* Offset de tiempo desde el trigger en ns */    50000,         /* perioso en us (50ms) */    0x10000,       /* Rango de escala del resultado (no usado) */    1,             /* Tamaño del buffer circular (sample count) */    ADC_TRIGGER_1  /* ID del trigger logico que inicia este canal del ADC */};/* *  Configurar ADC para que lea los valores en potenciometro y acelerometro */   void InitADC(void) {    fd_adc = fopen("adc:", (const char*)&amp;amp;adc_init);    if (NULL == fd_adc)     {            printf("\nFallo la inicializacion del ADC\n");        return;     }        fd_ch = fopen("adc:0", (const char*)&amp;amp;adc_ch_param);    if (fd_ch == NULL)     {            printf("\nadc:0 Error al abrir el canal del ADC\n");        return;    }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The IO_DEVICE struct that i've found in the Kernel_data in _io_fopen is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
IO_DEVICE --address:     0x00000000   Identifier:  "/" --address:     0x20000A78   Identifier:  "ttya:" --address:     0x20000C10   Identifer:   "gpio:" --address:     0x20000330   Identifier:  "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&amp;nbsp;and that's all the devices, so when i try to access the "adc:" returns error because the function did't found such device. Any idea about how can i initialiaze the ADC? Thanks in advance.&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2009 05:20:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Help-with-ADC/m-p/218330#M5663</guid>
      <dc:creator>Jairo</dc:creator>
      <dc:date>2009-09-27T05:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with ADC</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Help-with-ADC/m-p/218331#M5664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i recompiled the BSP files,apparently just modify the files don't make change in the code that would be downloaded to the target. Recompiling with the corresponding modifications and making a new project file was the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 00:04:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Help-with-ADC/m-p/218331#M5664</guid>
      <dc:creator>Jairo</dc:creator>
      <dc:date>2009-09-28T00:04:39Z</dc:date>
    </item>
  </channel>
</rss>

