Wrong ADC1_BASE in MK22F51212.h?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wrong ADC1_BASE in MK22F51212.h?

1,037 Views
marcohess
Contributor II

I am using a FRDM_K22 board which has I think an MK22F51212 device.

 

I am having some trouble with the eDMA on ADC1 running into errors. I init the eDMA source address with &ADC0->R[0] and &ADC1->R[0].

 

I now noted that while the ADC0 base address seems correct, the base address for ADC1 in the MK2251212.h header file is different from what is described in the reference manual.

 

My project (as started from a demo project in the KSDK and configured for a FRDM_K22 seems to include the header file platform/CMSIS/Include/device/MK22F51212/MK22F511212.h which defines the ADC1 base address as:

 

#define ADC1_BASE                                (0x40027000u)

 

while the K22 Sub-Family Reference Manual specifies:

 

0x400B_B000 for ADC1 (Page 161)

 

Is this a bug or am I looking in the wrong places?

Labels (1)
Tags (3)
0 Kudos
2 Replies

777 Views
marcohess
Contributor II

While all the reference documentation lists 0x400BB000 as the ADC1 address on the K22 I am getting a EDMA source bus error when I use that address

When I used the 0x40027000 for ADC1 I don't get the source bus error and it now seems to work.

0 Kudos

777 Views
trytohelp
NXP Employee
NXP Employee

Hi Marco,

In the MK22F51212.h file located in the KSDK installation folder (\KSDK_1.0.0\platform\CMSIS\Include\device\MK22F51212), the ADC are defined:

/* ADC - Peripheral instance base addresses */

/** Peripheral ADC0 base address */

#define ADC0_BASE                                (0x4003B000u)

/** Peripheral ADC0 base pointer */

#define ADC0                                    ((ADC_Type *)ADC0_BASE)

#define ADC0_BASE_PTR                            (ADC0)

/** Peripheral ADC1 base address */

#define ADC1_BASE                                (0x40027000u)

/** Peripheral ADC1 base pointer */

...

So ADC0=0x4003B000 and ADC1=0x40027000

I've checked in the documentation for the K22.

The Reference Manual is available on web site at the link: http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K22P121M120SF7RM.pdf

Page 150 there are:

    0x4002_7000 39 Analog-to-digital converter (ADC) 1

    0x4003_B000 59 Analog-to-digital converter (ADC) 0

May be the doc has been updated.


Have a great day,
Pascal Irrle

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos