Hi
It turns out I do have a chip, the "R8" which appears to be the big brother of the "C8". It is on a development board I bought a while back. Not sure if I have used it yet though.
If I still have it I'll try and see if I have similar issues.
Regards
STM32f030C8 UART Interrupt
-
- Valued Contributor
- Posts: 1313
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 317 times
- Been thanked: 458 times
Re: STM32f030C8 UART Interrupt
Hi ,
I would like to explain what this project is going to be about .
I am developing a data Analyzer for split type air-conditioners
data communication analyzer , recorder and playback
between the indoor and outdoor unit .
I was able to make this work but I felt like trying to reinvent the wheel , it got ridiculously complicated just to receive
a string and send it back, the macro receive string and send string should have done this as it dose on other targets
like stm32f4 , Atmega328 and 2560 .
I would like to explain what this project is going to be about .
I am developing a data Analyzer for split type air-conditioners
data communication analyzer , recorder and playback
between the indoor and outdoor unit .
I was able to make this work but I felt like trying to reinvent the wheel , it got ridiculously complicated just to receive
a string and send it back, the macro receive string and send string should have done this as it dose on other targets
like stm32f4 , Atmega328 and 2560 .
- Attachments
-
- Flowcode1.fcfx
- (15.2 KiB) Downloaded 207 times
-
- Valued Contributor
- Posts: 1213
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 118 times
- Been thanked: 622 times
Re: STM32f030C8 UART Interrupt
Can you try:
Attempting to read a string on UART (1200baud) - with a newline character ('\n' or 10) as end marker - depending how you send the string you might need to change this...
Martin
Attempting to read a string on UART (1200baud) - with a newline character ('\n' or 10) as end marker - depending how you send the string you might need to change this...
Martin
Re: STM32f030C8 UART Interrupt
Hi Martin ,
Thanks for your reply ,
split type air-conditioners Example GREE : communicate using 20 Hex bytes @1200 baud every 500ms , and the last byte
is a CheckSum8 Modulo 256 so it is expected to be always different unless nothing changes in the data .
So there is no end marker in the data ,but I will defiantly take a look at your flow see what I can steal from it .
Regards ,
Alan
Thanks for your reply ,
split type air-conditioners Example GREE : communicate using 20 Hex bytes @1200 baud every 500ms , and the last byte
is a CheckSum8 Modulo 256 so it is expected to be always different unless nothing changes in the data .
So there is no end marker in the data ,but I will defiantly take a look at your flow see what I can steal from it .
Regards ,
Alan
-
- Valued Contributor
- Posts: 1213
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 118 times
- Been thanked: 622 times
Re: STM32f030C8 UART Interrupt
If it's a fixed number of bytes then check 'pos' in the interrupt handler - if you've received 20 bytes then 'stop' (pos = 20 after increment (make buffer bigger and remove the % 20) - process the data and then resume.
This, of course, doesn't allow for transmission errors, timeouts etc - so will need a little extra checking to handle these (in a perfect world - life would be simpler?)
Martin
This, of course, doesn't allow for transmission errors, timeouts etc - so will need a little extra checking to handle these (in a perfect world - life would be simpler?)
Martin
-
- Valued Contributor
- Posts: 1313
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 317 times
- Been thanked: 458 times
Re: STM32f030C8 UART Interrupt
Hi
Just checked my board. Last night I looked online and the info suggested my chip would be similar to yours, but it's actually a STM32F446RET6.
I'll still have a play but it will be later in the week.
Regards
Just checked my board. Last night I looked online and the info suggested my chip would be similar to yours, but it's actually a STM32F446RET6.
I'll still have a play but it will be later in the week.
Regards
-
- Valued Contributor
- Posts: 1213
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 118 times
- Been thanked: 622 times
Re: STM32f030C8 UART Interrupt
I tested on a Nucleo-F401RE which is as near as I can get. 8Mhz at least?
I swapped to Channel 2 to try and use the Rx Tx pins on A2 and A3 - I couldn't read/write on Tx / Rx pins (using an FTDI chip) - but it did work connecting to the USB port on the board (in my case COM3) with putty.
I modified slightly to display the string on 20 chars received and set an LED on A5 on on interrupt - when displaying the string it turns the LED off again.
It seems to work - but if data is sent whilst printing the string then it stops working (LED no longer lights - interrupt not fired). This is a danger when mashing the keyboard and at such a slow baud rate..
I swapped to Channel 2 to try and use the Rx Tx pins on A2 and A3 - I couldn't read/write on Tx / Rx pins (using an FTDI chip) - but it did work connecting to the USB port on the board (in my case COM3) with putty.
I modified slightly to display the string on 20 chars received and set an LED on A5 on on interrupt - when displaying the string it turns the LED off again.
It seems to work - but if data is sent whilst printing the string then it stops working (LED no longer lights - interrupt not fired). This is a danger when mashing the keyboard and at such a slow baud rate..
Re: STM32f030C8 UART Interrupt
Hi
I have solved this issue using a circular Buffer , it is now working 100% without any issues .
Thanks to everyone for the help
Regards
Alan
I have solved this issue using a circular Buffer , it is now working 100% without any issues .
Thanks to everyone for the help
Regards
Alan
- Attachments
-
- RXTest.fcfx
- (18.75 KiB) Downloaded 213 times