Help converting file to work on ARM
Moderator: Benj
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Help converting file to work on ARM
Hi Flowcode Team,
Can anybody please look and convert the file that i have been using for years with PIC 8 and now want to start using STM ARM chips
I think some of the registers need to be changed it would be good if it could be used over PICs and ARMs universally.
Thanks for any help
Wayne Millard
Can anybody please look and convert the file that i have been using for years with PIC 8 and now want to start using STM ARM chips
I think some of the registers need to be changed it would be good if it could be used over PICs and ARMs universally.
Thanks for any help
Wayne Millard
- Attachments
-
- 570 070 TEST BOX_v6.fcfx
- (28.34 KiB) Downloaded 197 times
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Re: Help converting file to work on ARM
I have attached the code that needs to be converted from PIC to ARM 32F407VG to work with the correct registers.
Please help.
Wayne Millard
Please help.
Wayne Millard
- Attachments
-
- I need help to change the following C code to work on ARM.docx
- (16.51 KiB) Downloaded 188 times
-
- Valued Contributor
- Posts: 1188
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: Help converting file to work on ARM
Hi Wayne,
Looking at your code - it should be fairly straightforward to convert.... At present you have a custom interrupt for data received on the UART - but can you use a hardware UARTs and just use the RX interrupt - this would save a lot of trouble with undefined registers etc
Getting rid of the custom C code - and using standard flowcode would make portability straightforward.
Some of the C code implements a circular buffer - is this a throwback to using v5 - can you use the circular buffer component here (although there is perhaps no reason to change this - just makes the code a bit clearer and easier to run in simulation)
I would perhaps change the multi-level 'if' in check_received_packet to a 'switch' statement - again for clarity.
What is the program trying to achieve - ie what is the data source transmitting to the UART, what data is transmitted? - it's easier for you to describe than to reverse engineer your code
What is the target ARM processor etc?
Strangely - I'd just suggested this as an example in another thread - the 'mood light' example I submitted does something similar - receives data over UART and actions it when sufficient data received (in this case it was looking for a six byte 'command') - the principle is easy to modify for different command structures (for example a 3 character command). (see viewtopic.php?f=26&t=20701)
Martin
Looking at your code - it should be fairly straightforward to convert.... At present you have a custom interrupt for data received on the UART - but can you use a hardware UARTs and just use the RX interrupt - this would save a lot of trouble with undefined registers etc
Getting rid of the custom C code - and using standard flowcode would make portability straightforward.
Some of the C code implements a circular buffer - is this a throwback to using v5 - can you use the circular buffer component here (although there is perhaps no reason to change this - just makes the code a bit clearer and easier to run in simulation)
I would perhaps change the multi-level 'if' in check_received_packet to a 'switch' statement - again for clarity.
What is the program trying to achieve - ie what is the data source transmitting to the UART, what data is transmitted? - it's easier for you to describe than to reverse engineer your code
What is the target ARM processor etc?
Strangely - I'd just suggested this as an example in another thread - the 'mood light' example I submitted does something similar - receives data over UART and actions it when sufficient data received (in this case it was looking for a six byte 'command') - the principle is easy to modify for different command structures (for example a 3 character command). (see viewtopic.php?f=26&t=20701)
Martin
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Re: Help converting file to work on ARM
Hi Martin,
This is a software protocol that the company that i work for use. I have made many thing in the past using the code using PIC but need to start using ARM. This code was wrote by another engineer years ago but is not there now.
This is a protocol that use's three letter commands which are checked with a start of packet command checksum and then a end of packet.
Thanks for any of the help that you can provide.
Wayne Millard
This is a software protocol that the company that i work for use. I have made many thing in the past using the code using PIC but need to start using ARM. This code was wrote by another engineer years ago but is not there now.
This is a protocol that use's three letter commands which are checked with a start of packet command checksum and then a end of packet.
Thanks for any of the help that you can provide.
Wayne Millard
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Help converting file to work on ARM
HI.
This is always the proplem with changing micro manufacturer ,the code that you have been using and maintained for years is absolute and most of the time thier is no benefit in changing mcu manufacturer.
This is the nice thing about microchip you can upgrade to 16 bit or 32bit micro's having larger memory and much higer performance with very limited modifications to code you already have ,as the modules over the range PIC dsPIC,PIC24 and PIC32 is standard.
and there is no advantage using ARM 32 bit over PIC32 in many cases the PIC32 have better perforamnce.
This is always the proplem with changing micro manufacturer ,the code that you have been using and maintained for years is absolute and most of the time thier is no benefit in changing mcu manufacturer.
This is the nice thing about microchip you can upgrade to 16 bit or 32bit micro's having larger memory and much higer performance with very limited modifications to code you already have ,as the modules over the range PIC dsPIC,PIC24 and PIC32 is standard.
and there is no advantage using ARM 32 bit over PIC32 in many cases the PIC32 have better perforamnce.
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Re: Help converting file to work on ARM
Hi team.
I still need help on converting project from pic to arm.
Thank for any help
Wayne
I still need help on converting project from pic to arm.
Thank for any help
Wayne
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Help converting file to work on ARM
Hi Wayne,
Martin's suggestion seems to be pretty good.
Martin's suggestion seems to be pretty good.
Why not have a go and post where you get to and we can hopefully suggest ways to get around problems.Looking at your code - it should be fairly straightforward to convert.... At present you have a custom interrupt for data received on the UART - but can you use a hardware UARTs and just use the RX interrupt - this would save a lot of trouble with undefined registers etc
Getting rid of the custom C code - and using standard flowcode would make portability straightforward.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Re: Help converting file to work on ARM
Hi Benj,
Thanks for the reply i would try to do this but i do not understand the C code to try to change it to flowcode.
This is the main problem why i cant do this
Thanks,
Wayne
Thanks for the reply i would try to do this but i do not understand the C code to try to change it to flowcode.
This is the main problem why i cant do this
Thanks,
Wayne
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Help converting file to work on ARM
Hi,
It cost a few dollars(few hours work) but you done and can go forward ,
Just my thinking
Wayne why don't you /your company get one of the free lance engineers to help you with that part.i do not understand the C code to try to change it to flowcode.
This is the main problem why i cant do this
It cost a few dollars(few hours work) but you done and can go forward ,
Just my thinking
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Help converting file to work on ARM
Hi Wayne,
I've attached a modified version to get you going.
I think I've replaced all C code with Flowcode,
it does not need to be C code, as mentioned by others, Flowcode can take care of the UART, interrupt etc.
Only took a few minutes, so won't charge this time
I've attached a modified version to get you going.
I think I've replaced all C code with Flowcode,
it does not need to be C code, as mentioned by others, Flowcode can take care of the UART, interrupt etc.
Only took a few minutes, so won't charge this time
- Attachments
-
- 570 070 TEST BOX_v8.fcfx
- (30.74 KiB) Downloaded 147 times
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Re: Help converting file to work on ARM
Thanks Leigh for your help i will try the new file.
Thanks,
Wayne
Thanks,
Wayne