2015-05-20 09:58 AM
Hello. I'm new to microcontrolles and I need to write a program that allows sending counter every 15 miliseconds through USART2. Counter should increase every second. I got the sending part. It's working but I can't get this counter and sending after 15 ms to work. Can anyone help?
2015-05-20 06:23 PM
Well you could configure the SysTick to fire every 1ms (1KHz), count every 15 entries to the ticker interrupt, and initiate the data send, count every 1000 entries to get your 1 second count.
ST makes dozens of STM32 parts, you'll need to be specific about which one.2015-05-21 04:23 AM
I have the sending part with delay but I can't figure out how to increment and sending int variable to terminal. I got NUCLEO 411RE
2015-05-21 04:39 AM
> I can't figure out how to increment
variable++; > and sending int variable to terminal char[10] buf; unsigned int i; sprintf(buf, ''%d\n'', variable); for (i = 0; s[i] != '\0'; i++) { SendOneCharacterThroughUart(s[i]); } You might perhaps want to take some general C course and start with a somewhat simpler project - blinking a LED is usually the first one should start with. JW2015-05-21 04:45 AM
Well I wrote it wrong way. I know how to increment variables but I could not get sending it just right. I could only see <0> in terminal. Thank You for your help.