ADC in non-interupt mode

Hi everyone I have problem with ADC->ADC_INT register dont change value 0->1 after ADC conversion end . It is a bug ?

void ADC_INIT (void)
{
    ADC->ADC_CTR = ADC_CTR_PWD_NRMOP;
}
uint16_t ADC_START ( const uint8_t channel)
{
    ADC->ADC_CHSEL = channel;// select channel
    ADC->ADC_START = ADC_START_START; // start conversion
    return ADC->ADC_INT;
}

        sprintf(UART_BUFFER,"ADC CHANNEL 0 start conversion %d ADC_INT= %d\r\n\0",330*ADC->ADC_DATA/4096,ADC_START(0)); // start conversion function ADC_START return ADC_INT value
        S_UartPuts (UART_BUFFER);
        delay_ms(100); // wait end conversion
        sprintf(UART_BUFFER,"ADC CHANNEL 0 end conversion %d ADC_INT= %d\r\n\0",330*ADC->ADC_DATA/4096,ADC->ADC_INT);
        S_UartPuts (UART_BUFFER);

ADC_INT_VALUE
ADC CLK is 1Mhz , I start conversion and I will check ADC_INT value its correctly zero, next I wait 100ms , I think that at 1Mhz, after 100ms, the transfer will definitely end and I will check ADC_INT value, but value is permanently zero. However ADC_DATA register changes its value according to the set voltage.
Thanks for help

I am unable to assist you precisely because I do not have access to the entire code you possess.
To use the ADC, it is recommended to configure it using the structure declared in the W7500 GPIO header file, similarly to how you would set up GPIO. Additionally, to utilize interrupts, you should add your desired actions to the ADC interrupt handler. If you want to know the detailed method, please refer to the link below.

W7500 interrupt example link : W7500x_StdPeriph_Lib/Projects/W7500x_StdPeriph_Examples/ADC/ADC_Interrupt at master · Wiznet/W7500x_StdPeriph_Lib · GitHub

Interrupt works fine, problem is in non-interrupt mode

Okay I’m using the code from the repository Project: ADC → Illumination_RGBLED
and I modified the ADC_Read(ADC_CH num) function to return the value of the ADC_INT register after the conversion has started
I have the same result ADC_INT does not change the value is always zero

	printf(" Start conversion ADC_INT value = %d\r\n",ADC_Read(ADC_CH0)); // function ADC_Read(x)  start conversion and return ADC->ADC_INT register
	delay_ms(100); // wait to end conversion
	printf(" END conversion ADC_INT value = %d\r\n",ADC->ADC_INT); // end conversion read ADC->ADC_INT register

All Code :

/*******************************************************************************************************************************************************
 * Copyright ¨Ï 2016 <WIZnet Co.,Ltd.>
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ¡°Software¡±),
 * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED ¡°AS IS¡±, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************************************************************************************************/
/**
  ******************************************************************************
  * @file    ADC/Illumination_RGBLED/main.c
  * @author  IOP Team
  * @version V1.0.0
  * @date    25-AUG-2015
  * @brief   Main program body
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, WIZnet SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2015 WIZnet Co.,Ltd.</center></h2>
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include "W7500x.h"
#include "W7500x_adc.h"
#include "W7500x_uart.h"
#include "W7500x_gpio.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
int sensorValue;
int ADC_INT_STATUS;
int color = 1;
char on = 0;

/* Private function prototypes -----------------------------------------------*/
void UART_Configuration(void);
void delay_ms(__IO uint32_t nCount);
void on_off_rgb(unsigned int color);
int ADC_Read(ADC_CH num);
void GPIO_Setting(void);
  static  uint32_t counter = 0x00;
/* Private functions ---------------------------------------------------------*/

/**
  * @brief   Main program
  * @param  None
  * @retval None
  */


int main()
{
    /*System clock configuration*/
    SystemInit();

    /* GPIO configuration */
    GPIO_Setting();

    /* UART configuration */
    UART_Configuration();

    printf("*****  Illumination sensor & rgb led  *****\r\n");
    printf("***********         WIZnet         ***********\r\n");

    // ADC initialize
    ADC_Init();
    while(1) {

	printf(" Start conversion ADC_INT value = %d\r\n",ADC_Read(ADC_CH0)); // function ADC_Read(x)  start conversion and return ADC->ADC_INT register
	delay_ms(100); // wait to end conversion
	printf(" END conversion ADC_INT value = %d\r\n",ADC->ADC_INT); // end conversion read ADC->ADC_INT register
	if (sensorValue < 3000) {
			on_off_rgb(0);
			if (on == 1)
					color ++;
			on = 0;
			if (color == 8)
					color = 1;
	}
	else {on_off_rgb(color); on = 1; }
	delay_ms(100);
    }
}

void delay_ms(__IO uint32_t nCount)
{
    volatile uint32_t delay = nCount * 2500; // approximate loops per ms at 24 MHz, Debug config
    for(; delay != 0; delay--)
        __NOP();
}

void on_off_rgb(unsigned int color)
{
    // R : PC_00, G : PC_04, B : PC_05
    if (color%2)      GPIO_SetBits(GPIOC, GPIO_Pin_0); else GPIO_ResetBits(GPIOC, GPIO_Pin_0);
    if ((color>>1)%2) GPIO_SetBits(GPIOC, GPIO_Pin_4); else GPIO_ResetBits(GPIOC, GPIO_Pin_4);
    if ((color>>2)%2) GPIO_SetBits(GPIOC, GPIO_Pin_5); else GPIO_ResetBits(GPIOC, GPIO_Pin_5);
}

int ADC_Read(ADC_CH num)
{
    ADC_ChannelSelect (num); ///< Select ADC channel to CH0
    ADC_Start(); ///< Start ADC
   // while(ADC_IsEOC()); ///< Wait until End of Conversion
    return ADC->ADC_INT;//< return ADC_INT status //((uint16_t)ADC_ReadData()); ///< read ADC Data
}

void GPIO_Setting(void)
{
    GPIO_InitTypeDef GPIO_InitStructure;

    /*GPIO Configuration for red,green,blue LED */
    PAD_AFConfig(PAD_PC,GPIO_Pin_0,PAD_AF1); ///< PAD Config - RED LED used 2nd Function
    PAD_AFConfig(PAD_PC,GPIO_Pin_4,PAD_AF1); ///< PAD Config - GREEN LED used 2nd Function
    PAD_AFConfig(PAD_PC,GPIO_Pin_5,PAD_AF1); ///< PAD Config - BLUE LED used 2nd Function

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_4 | GPIO_Pin_5; ///< Connecting GPIO_Pin_0(R),4(G),5(B)
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; ///< Set to GPIO Mode to Output Port
    GPIO_Init(GPIOC, &GPIO_InitStructure);
}

void UART_Configuration(void)
{
     UART_InitTypeDef UART_InitStructure;

     /* UART Configuration for UART1*/
     UART_StructInit(&UART_InitStructure);
     UART_Init(UART1,&UART_InitStructure);
     S_UART_Init(115200);
}

So seems that if you enable the ADC interrupt enable, but leave the NVIC IRQ disabled, that non-interrupt mode works ok.

Tried it on my setup ( with no interrupt handler ) & is ok now.

My code is written in Oberon, is working ok now.

So seems that if you enable the ADC interrupt enable, but leave the NVIC IRQ disabled, that non-interrupt mode works ok.
Tried it on my setup ( with no interrupt handler ) & is ok now.
My code is written in Oberon, is working ok now.

Thanks now is really work , this is a bug in ADC

One detail after conversion is necessary to clear interrupt in ADC_INTCLR

I update flowchart from reference manual

#define ADC_TIMEOUT 1000

void ADC_INIT (void)
{
    ADC->ADC_CTR = ADC_CTR_PWD_NRMOP; // enable adc
    ADC->ADC_INT = ADC_INT_MASK_ENA; // enable interrupt
}

uint8_t ADC_START ( const uint8_t channel)
{
    ADC->ADC_CHSEL = channel;// select channel
    ADC->ADC_INTCLR = ADC_INTCLEAR;// clear INT flag
    if (ADC->ADC_INT&0x01) // check that the INT flag is really clear!!!
        return 0xff; // return error
    ADC->ADC_START = ADC_START_START; // start conversion

    return 0; // everything is OK
}

uint16_t ADC_READ (uint16_t timeout)

{
    while (!(ADC->ADC_INT&0x01));// wait to end conversion
    {
        if(timeout == 0)
            return 0xffff; // return error
        else
            timeout--;

            __NOP();

    }
    return ADC->ADC_DATA;
}

Now the code works correctly

        ADC_START(ADC_CHSEL_CH0);// select channel and star conversion
        sprintf(UART_BUFFER,"ADC CHANNEL 0 start conversion ADC_INT= %d\r\n\0",ADC->ADC_INT&0x01); // start conversion function ADC_START return ADC_INT value
        S_UartPuts (UART_BUFFER);
        ADC_DATA = ADC_READ(ADC_TIMEOUT); // wait end conversion and read data
        sprintf(UART_BUFFER,"ADC CHANNEL 0 end conversion data= %d ADC_INT= %d\r\n\0",ADC_DATA,ADC->ADC_INT&0x01);
        S_UartPuts (UART_BUFFER);

image

And I would like to ask you to delete the I2C data on your site https://www.wiznet.io/product-item/w7500p/ if not supported HW I2C


Because all your distributors are writing this wrong information

For example : https://eu.mouser.com/ProductDetail/WIZnet/W7500P?qs=49jCJYXrXPhG03qIHZCeEQ%3D%3D or
https://www.tme.eu/en/details/w7500p/microcontrollers-others/wiznet/

Next question is what is accuracy LDO on CH15?

Thanks for the information