Created
March 15, 2017 14:52
-
-
Save 2garryn/23618e29817611c02734c932a5d0a829 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DMA_DeInit(DMA1_Stream5); | |
DMA_INIT.DMA_Channel = DMA_Channel_7; | |
DMA_INIT.DMA_PeripheralBaseAddr = (uint32_t)&DAC->DHR12L1;//->DHR12R1;// &DAC->DHR12L1; DHR8R1; | |
DMA_INIT.DMA_Memory0BaseAddr = (uint32_t)&dac_buff; | |
DMA_INIT.DMA_DIR = DMA_DIR_MemoryToPeripheral; | |
DMA_INIT.DMA_BufferSize = 512; | |
DMA_INIT.DMA_PeripheralInc = DMA_PeripheralInc_Disable; | |
DMA_INIT.DMA_MemoryInc = DMA_MemoryInc_Enable; | |
DMA_INIT.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; | |
DMA_INIT.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; | |
DMA_INIT.DMA_Mode = DMA_Mode_Circular; | |
DMA_INIT.DMA_Priority = DMA_Priority_High; | |
DMA_INIT.DMA_FIFOMode = DMA_FIFOMode_Disable; | |
DMA_INIT.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; | |
DMA_INIT.DMA_MemoryBurst = DMA_MemoryBurst_Single; | |
DMA_INIT.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; | |
DMA_Init(DMA1_Stream5, &DMA_INIT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
Im trying to address Memory0BaseAddr to DMA based on character i get from USART. so my code looks like this:
small part of DMA.c looks like:
void put(){
znak=USART_ReceiveData(USART1);
if (a!=znak){
USART1_SendChar(znak);
a=znak;
my main.c looks like:
int main(void){
}
i just get random signal like none of if{}s passed the check, even though i really type 2,3, or 6.
I tested serial communication and it works fine.