[SOLVED] [DUPLICATE POST] How to use USART1_IRQhandler with stm32f103

Working libraries, libraries being ported and related hardware
Post Reply
Gold3nn
Posts: 9
Joined: Sat Apr 08, 2017 7:59 am

[SOLVED] [DUPLICATE POST] How to use USART1_IRQhandler with stm32f103

Post by Gold3nn » Wed Aug 23, 2017 2:38 pm

How do I use the usart interrupt with stm32fduino? Do you have sample code?

Thanks in advance

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: How to use USART1_IRQhandler with stm32f103

Post by RogerClark » Wed Aug 23, 2017 8:51 pm

Which repo are you using?

Implementation is completely different in each repo

zmemw16
Posts: 1422
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: How to use USART1_IRQhandler with stm32f103

Post by zmemw16 » Wed Aug 23, 2017 10:07 pm

the HAL way would be to install cubemx with the f1 repository, review the examples. the f4 one has a pretty full set of usart interfaces.
the SPL way would be to install unicore-mx-examples (uses OpenCM3/SPL)
github is another place to browse
of course googling 'stm32f103 uart usart interrupt example tutorial'
additionally add site: as per Ray's example :)
you've a lot of reading to do ... ...

stephen

Gold3nn
Posts: 9
Joined: Sat Apr 08, 2017 7:59 am

Re: How to use USART1_IRQhandler with stm32f103

Post by Gold3nn » Thu Aug 24, 2017 6:46 am

I use stm32f103. I looked at the examples but I did not understand much. If you have an example of a link-side code that you can suggest, I'm open to the whole proposal.

Gold3nn
Posts: 9
Joined: Sat Apr 08, 2017 7:59 am

Re: How to use USART1_IRQhandler with stm32f103

Post by Gold3nn » Thu Aug 24, 2017 6:49 am

void setup() {
// put your setup code here, to run once:
Serial1.begin(9600);
pinMode(PA0, INPUT_ANALOG);
}

void loop() {
// put your main code here, to run repeatedly:
{
char gelen = Serial1.read();

{
Serial1.print("merhaba");
float okunan = analogRead(PA0);
okunan=(okunan/4096)*3300;
Serial1.print(okunan);
okunan = okunan/10;
Serial1.print("<< >>");
Serial1.println(okunan);
delay(50);
}
}
}

Here's how to operate the usart interrupt. ?

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: How to use USART1_IRQhandler with stm32f103

Post by RogerClark » Thu Aug 24, 2017 7:43 am

Which repo did you download from. There are 3 completely different github accounts / repo's that you could be using

However my guess is you are using Arduino_STM32 from my github account www.github.com/rogerclarkmelbourne ???

Gold3nn
Posts: 9
Joined: Sat Apr 08, 2017 7:59 am

Re: How to use USART1_IRQhandler with stm32f103

Post by Gold3nn » Thu Aug 24, 2017 7:51 am

I downloaded the libraries in your github files. So I use your libraries.

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: How to use USART1_IRQhandler with stm32f103

Post by RogerClark » Thu Aug 24, 2017 10:38 am

You should have searched the site first.

There is already a thread about this with a solution.

Well, not an ideal solution but a solution

http://www.stm32duino.com/viewtopic.php?f=18&t=1139

Post Reply