-
Notifications
You must be signed in to change notification settings - Fork 3k
lpc546xx: fix adc #5516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lpc546xx: fix adc #5516
Conversation
/morph build |
Build : FAILUREBuild number : 541 |
Please look at failure |
Resolve #5304
Both targets, LPC546XX and LPC54144 compile now.
Tested only LPC546XX which i have. |
uint32_t pin_number = pin & 0x1F; | ||
uint8_t port_number = pin / 32; | ||
|
||
/* Clear the PDEN_ADC0 bit in the PDRUNCFG0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit is cleared inside ADC_ClockPower_Configuration() function. The below lines of code can be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My debugger is saying its not cleared and i get wrong measurements, always around 1700. Ill check again and let you know...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its called DIGIMODE bit. Ill correct
@@ -69,6 +77,7 @@ uint16_t analogin_read_u16(analogin_t *obj) | |||
adcConvSeqConfigStruct.interruptMode = kADC_InterruptForEachSequence; | |||
|
|||
ADC_SetConvSeqAConfig(adc_addrs[instance], &adcConvSeqConfigStruct); | |||
ADC_EnableConvSeqA(adc_addrs[instance], true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this, apologies for missing this line.
reg = IOCON->PIO[port_number][pin_number] & ~IOCON_PIO_DIGIMODE_MASK; | ||
reg &= ~(1UL << SYSCON_PDRUNCFG_PDEN_ADC0_SHIFT); | ||
reg &= ~(1UL << IOCON_PIO_DIGIMODE_SHIFT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this line as the previous line has already cleared the bit.
/morph build |
Build : SUCCESSBuild number : 553 Triggering tests/morph test |
Exporter Build : ABORTEDBuild number : 168 |
/morph export-build |
Exporter Build : SUCCESSBuild number : 171 |
Fix #5304 according to UM10912.pdf (Chapter 44.3)
Status
Ready