Where is KL27 DAC12 Support in SDK?

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

Where is KL27 DAC12 Support in SDK?

Jump to solution
887 Views
bcstewart
Contributor III

Writing code of KL27128 48 QFN.

The SDK for KL27 does not support the DAC12.  There is no API documentation.  The registers are not defined in MKL27Z4.h.  

What happened?

Tags (2)
1 Solution
616 Views
bcstewart
Contributor III

I found out why the DONE bit is cleared.  The SDK does it in DMA_HandleIRQ.  This is an unfortunate consequence of using SDKs.  

All is good.  I got it running.  No more help needed.

View solution in original post

0 Kudos
5 Replies
616 Views
bcstewart
Contributor III

I'm using correct SDK (KL27Z256).

The issue is that it's not mentioned at all in the documentation.

How do you set the ERQ bit in DMA_DCRx?  I don't see how SDK support this.

I am using a PWM counter TPM1 Ch0 to drive the DMA to transfer 16-bit values from memory to the DAC.  

When the interrupt occurs, the BCR is zero (as it should be), but the DONE bit is never set.

Do you have any idea why this is?  I need to run this in a constant loop.  It's an audio application where sound data in SRAM is continuously sent to the DAC at a fixed sample rate (22KHz).  I've done this before using the K22F and KL25 with great success (I used Processor Expert to initialize the peripherals).

Attached is my code.

Brad

0 Kudos
617 Views
bcstewart
Contributor III

I found out why the DONE bit is cleared.  The SDK does it in DMA_HandleIRQ.  This is an unfortunate consequence of using SDKs.  

All is good.  I got it running.  No more help needed.

0 Kudos
616 Views
bcstewart
Contributor III

Also, I get hard faults anytime I try to access the DAC registers.

For example,

#define DAC0_C0  (*(uint8_t volatile * )(DAC0_BASE + 0x21))

uint8_t k;

k= DAC0_C0; //<--causes a hard fault!

I have no problem using this method to read and write to GPIOC.  It seems to be an issue with the DAC0.  I get errors even by writing to DAC0_C0 in the debugger (using Keil MDK).  

0 Kudos
616 Views
bcstewart
Contributor III

It turns out that the DAC clock is not set in SIM_SCGC6 (bit 31).  Once set, it seems to work.

Neither the pin or clock configuration tools do this.

You need to support the DAC in your SDK and need to release the peripheral configuration tool ASAP!

616 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

- When download KSDK for KL27128 , please choose the exactly device :

pastedImage_1.png

it includes the API for dac:

pastedImage_2.png

- About the peripheral configuration tool,  it is now in field trail stage .

Hope it helps


Have a great day,
TIC

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

0 Kudos