Help converting file to work on ARM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
wayne millard
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

Post by wayne millard »

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 :oops:
Attachments
570 070 TEST BOX_v6.fcfx
(28.34 KiB) Downloaded 197 times

wayne millard
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

Post by wayne millard »

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 :oops:
Attachments
I need help to change the following C code to work on ARM.docx
(16.51 KiB) Downloaded 188 times

mnf
Valued Contributor
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

Post by mnf »

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

wayne millard
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

Post by wayne millard »

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

User avatar
QMESAR
Valued Contributor
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

Post by QMESAR »

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.

wayne millard
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

Post by wayne millard »

Hi Martin

I want to start to use STM32F407VG.

Thanks
Wayne

wayne millard
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

Post by wayne millard »

Hi team.

I still need help on converting project from pic to arm.

Thank for any help
Wayne

User avatar
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

Post by Benj »

Hi Wayne,

Martin's suggestion seems to be pretty good.
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.
Why not have a go and post where you get to and we can hopefully suggest ways to get around problems.

wayne millard
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

Post by wayne millard »

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 :oops:

Thanks,
Wayne

User avatar
QMESAR
Valued Contributor
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

Post by QMESAR »

Hi,
i do not understand the C code to try to change it to flowcode.
This is the main problem why i cant do this
Wayne why don't you /your company get one of the free lance engineers to help you with that part.
It cost a few dollars(few hours work) but you done and can go forward ,
Just my thinking :D

User avatar
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

Post by LeighM »

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 :wink:
Attachments
570 070 TEST BOX_v8.fcfx
(30.74 KiB) Downloaded 147 times

wayne millard
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

Post by wayne millard »

Thanks Leigh for your help i will try the new file.

Thanks,
Wayne

Post Reply