This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USART Handler getting overrun by TIM6_DAC handler?

We are making our DAC output a sinusoid of variable frequency depending on a button we press. The DAC does work when we hard code which button WE press but not with UART. With the UART handler (used for receiving the  "button" we press and incrementing it in software), the DAC handler is always running and never lets the UART handler start "pressing" the button so it never activates the DAC. We think that the handler is getting overrun by the TIM6_DAC because when we disable TIM6, the UART handler is initiated (but then there is not DAC conversion). We overcame the relatively slow speed of the ADC in the channel reads and the button presses are represented by the arrays and KEY#'s.

STM32F051R8T6

EDIT: DAC is set to trigger every 10us and the uart is set to interrupt whenever the receiver has a bit recieved

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*#include "stm32f0xx.h"
#include "stm32f0_discovery.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define RATE 100000
#define N 1000
#define PB_CH 0
#define ATTACK_CH 10
#define DECAY_CH 11
#define SUSTAIN_CH 12
#define RELEASE_CH 13
#define IDLE 0xFE
#define KEY1 0x34
#define KEY2 0x35
#define KEY3 0x36
#define KEY4 0x37
#define KEY5 0x38
#define KEY6 0x39
#define KEY7 0x3A
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0