Part Number: MSP432E401Y
Other Parts Discussed in Thread: MSP-EXP432E401Y,
Hi!
Currently i'm working with MSP432E401Y on MSP-EXP432E401Y.
Last 2 days i'm trying to configure ADC on registers, but this doesn't work.
My initialization sequence it the same as in Technical Reference Manual.
But bit BUSY in ADCACTSS always set in 1. In ADCSSFIFO0 - random value, which is generated during initialization. I'm too tired, so I need your help, please!
Source code:
/* PK1 - AIN17 */ /* Enable the GPIOK clock */ SYSCTL_RCGCGPIO |= (1 << 9); /* Wait for GPIOK ready */ while (!(SYSCTL_PRGPIO & (1 << 9))); /* Enable alternate function */ GPIO_AFSEL(GPIOK) |= (1 << 1); /* Disable digital mode */ GPIO_DEN(GPIOK) &= ~(1 << 1); /* Enable analog mode */ GPIO_AMSEL(GPIOK) |= (1 << 1); /* Disable pull-up */ GPIO_PUR(GPIOK) &= ~(1 << 1); /* Disable pull-down */ GPIO_PDR(GPIOK) &= ~(1 << 1); /* Enable the ADC0 clock */ SYSCTL_RCGCADC |= (1 << 0); /* Wait for ADC0 ready */ while (!(SYSCTL_PRADC & (1 << 0))); /* ADC0 Software Reset Enable */ SYSCTL_SRADC |= (1 << 0); /* ADC0 Software Reset Disable */ SYSCTL_SRADC &= ~(1 << 0); /* Wait for ADC0 ready */ while (!(SYSCTL_PRADC & (1 << 0))); /* Reference Select - external VREF+ and VREF- */ ADC_CTL(ADC0) |= (1 << 0); /* ADC Sequencer - 1 */ /* ADC Sample - 1st */ /* Enable input select (upper bit) for 1st sample */ ADC_SSEMUX1(ADC0) |= (1 << 0); /* Select 16+1 = 17 analog input for 1st sample */ ADC_SSMUX1(ADC0) |= (0x01); /* Sequencer 1 trigger - processor by default */ /* Sample and hold period for 1st sample - 256 ADC clocks */ ADC_SSTSH1(ADC0) = 0xC; /* Set End of Sequence Bit for 1st Sample */ ADC_SSCTL1(ADC0) |= (1 << 1); /* Enable Sequencer 1 */ ADC_ACTSS(ADC0) |= (1 << 1); /* Initiate Sequencer 1 */ ADC_PSSI(ADC0) |= (1 << 1); while (1);
Many thanks for your help!
