Author Topic: ADC Simulation  (Read 14418 times)

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
ADC Simulation
« on: November 19, 2009, 09:17:18 AM »
Hello,

On my release I didn't find the simulator structure for ADC on simLPC23XX.h, is it normal?
I put one to make my simulator works, but if there is another let me know.

Code: [Select]
typedef struct stLPC23XX_PERIPH
{
    LPC23XX_FAST_GPIO   ucFastGPIO[5];
    LPC23XX_WATCHDOG    ucWDOG;
    LPC23XX_TIMER       ucSimTimer0;
    LPC23XX_TIMER       ucSimTimer1;
    LPC23XX_UART        ucSimUart0;
    LPC23XX_UART        ucSimUart1;
    LPC23XX_IIC         ucIIC0;
    LPC23XX_RTC         ucRTC;
    LPC23XX_LEG_GPIO    ucLegacyGPIO;
    LPC23XX_PIN_CON     ucPIN_CON;
    LPC23XX_SSP         ucSSP1;
    LPC23XX_ADC         ucADC; //ADD//191109//
    LPC23XX_IIC         ucIIC1;
    LPC23XX_SSP         ucSSP0;
    LPC23XX_TIMER       ucSimTimer2;
    LPC23XX_TIMER       ucSimTimer3;
    LPC23XX_UART        ucSimUart2;
    LPC23XX_UART        ucSimUart3;
    LPC23XX_IIC         ucIIC2;
    LPC23XX_RTC_RAM     ulRTC_ram;
    LPC23XX_SCM         ucSCM;
    LPC23XX_EMAC        ucEMAC;
    LPC23XX_EMC         ucEMC;
    LPC23XX_LCD         ucLCD;
    LPC23XX_VIC         ucVIC;
    LPC23XX_VIC_ADD     ucVICAddress;
} LPC23XX_PERIPH;

typedef struct stLPC23XX_ADC
{
unsigned long AD_CR;
unsigned long AD_GDR;
unsigned long AD_INTEN;
unsigned long AD_DR0;
unsigned long AD_DR1;
unsigned long AD_DR2;
unsigned long AD_DR3;
unsigned long AD_DR4;
unsigned long AD_DR5;
unsigned long AD_DR6;
unsigned long AD_DR7;
unsigned long AD_STAT;
} LPC23XX_ADC;
« Last Edit: November 19, 2009, 01:51:53 PM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3239
    • View Profile
    • uTasker
Re: ADC Simulation
« Reply #1 on: November 19, 2009, 01:56:25 PM »
Hi Hervé

This is correct - the ADC in the LPC2XXX has not been used in the project and is also not simulated at the moment (by some of the targets it is possible to apply voltages to the ADC inputs in the simulator, view the voltages and also change them. This is useful for testing SW monitoring and reacting to thresholds, for example, whereby some of the ADC in the processors (like the M522XX) even have programmable threshold trigger levels which automatically generate interrupts when reached.

I will see whether I can add this shortly.

Regards

Mark