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

Merged
merged 3 commits into from Nov 22, 2017

Conversation

Projects
None yet
5 participants
@gorazdko
Contributor

gorazdko commented Nov 16, 2017

Fix #5304 according to UM10912.pdf (Chapter 44.3)

Status

Ready

@gorazdko

This comment has been minimized.

Contributor

gorazdko commented Nov 16, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 17, 2017

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Nov 17, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 17, 2017

Please look at failure [Error] analogin_api.c@47,0: #20: identifier "SYSCON_PDRUNCFGCLR_PDEN_ADC0_SHIFT" is undefined

@0xc0170 0xc0170 added needs: work and removed needs: review labels Nov 17, 2017

lpc546xx: fix adc
Resolve #5304

@gorazdko gorazdko force-pushed the gorazdko:lpc546xx-fix-adc branch to d62b473 Nov 17, 2017

@gorazdko

This comment has been minimized.

Contributor

gorazdko commented Nov 17, 2017

Both targets, LPC546XX and LPC54144 compile now.

SYSCON_PDRUNCFG_PDEN_ADC0_SHIFT is seen by both.

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 */

This comment has been minimized.

@mmahadevan108

mmahadevan108 Nov 17, 2017

Contributor

This bit is cleared inside ADC_ClockPower_Configuration() function. The below lines of code can be deleted.

This comment has been minimized.

@gorazdko

gorazdko Nov 17, 2017

Contributor

My debugger is saying its not cleared and i get wrong measurements, always around 1700. Ill check again and let you know...

This comment has been minimized.

@gorazdko

gorazdko Nov 17, 2017

Contributor
  • If i delete lines:
    withoutlines

  • If i dont:
    withlines

This comment has been minimized.

@gorazdko

gorazdko Nov 17, 2017

Contributor

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);

This comment has been minimized.

@mmahadevan108

mmahadevan108 Nov 17, 2017

Contributor

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);

This comment has been minimized.

@mmahadevan108

mmahadevan108 Nov 17, 2017

Contributor

Don't need this line as the previous line has already cleared the bit.

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Nov 20, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 20, 2017

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Nov 20, 2017

Build : SUCCESS

Build number : 553
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5516/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 20, 2017

/morph export-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Nov 22, 2017

@theotherjimmy theotherjimmy merged commit a834425 into ARMmbed:master Nov 22, 2017

6 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment