Presentation and some consideration on Pin problems

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

Moderator: Benj

Post Reply
zumpitu
Posts: 22
Joined: Tue Jul 03, 2018 12:21 pm
Location: Southam UK
Has thanked: 4 times
Been thanked: 2 times
Contact:

Presentation and some consideration on Pin problems

Post by zumpitu »

Hi All

I'm Sacha and this is my first post on this forum,
As 3D designer and Cnc enthusiast I want to create some projects with a Nucleo 64 Board, on the specific a 3 phase motor controller, but ideally also a lot more.

I found out Flowcode and I was absolutely enthusiastic about it, to me feel very much the way to go as I'm not a good programmer but I'm struggling so much with some basics task that make me consider to not purchase it (im on the 30 Days trial version )

The only platform I need to work on is the ARM 32 bit , right now I'm using a Nucleo64 STM6432F446.

Main problem I have is regarding the Pin I can not find the way to use the all the Pin or to connect them , not all PIN are show on the chip , I know from documentation that is possible to show all the chip propriety (http://www.matrixtsl.com/wiki/index.php?title=Chip_View ) but is also to me very unclear how to use it.

Also is frustrating for me the way the Pin are named ... is it possible to just use the original name , like PA_0, PA_1 ecc... ? this will make everything more easy since all the document refer to that nomenclature, I would change the name even manually if is possible this is also a problem if I need to use some other C code, I will have to convert all the Pin names .


Thank you

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: Presentation and some consideration on Pin problems

Post by LeighM »

Hi,

Welcome to the forum!

The pinouts for the "chip" definitions for the Nucleo boards are restricted to the Arduino compatible pins.
We don't currently have a definition for the 32F446RE device that the Nucleo 64 Board uses.
There is however the 32F446ZE, which has more pins, so this could be used as your target device instead of the Nucleo board.
You would just need to be careful not to use pins that don't exist on the 446RE, but at least all the pins you can use will be visible in the chip view and usable in your projects.

The Nucleo definitions also simplify the programming of the Nucleo board, wheras the raw chip definitions do not, however you should still be able to run your programs by simply copying the compiled .bin file from your project directory onto the virtual drive of the attached Nucleo board.

Hope that helps,
Leigh

zumpitu
Posts: 22
Joined: Tue Jul 03, 2018 12:21 pm
Location: Southam UK
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Presentation and some consideration on Pin problems

Post by zumpitu »

Hi LeighM , Thank you for the reply

I will try want you suggest , I see that the 32F446ZE is the version of the chip used on the Nucleo 144.

I checked on CubeMX and looks they have the same Pinout so probably it will work.

Is it possible to import the setting from CubeMX ? This will help to configure the board for some specific parameter, even if I can see that flowcode also have some way to configure the chip.

For me is a bit confusing for example the clock setting.. on General setting I can find a clock value, ( for the 32F446RE is set to 80 Mhz but should be 180 Mhz and for the 32F446ZE is set to 160 Mhz when should be 180 Mhz ).
Then I have the advanced tab where I can also change the setting.

Will be also interesting to understand why flowcode use this strange Pin names , there is any documentation regarding this ?

Thank you so much again, I highly appreciated

Sacha

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: Presentation and some consideration on Pin problems

Post by LeighM »

Hi Sacha
The clock setting in the General setting is the input clock or crystal frequency, on the Nucleo board this is 8MHz.
CubeMX is useful for determining all the dividers and multiplier values required to give you your required system clocks.
These values can then be copied into the advanced tab settings.
Leigh

zumpitu
Posts: 22
Joined: Tue Jul 03, 2018 12:21 pm
Location: Southam UK
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Presentation and some consideration on Pin problems

Post by zumpitu »

ho I see, sorry for the mistake.

I write a small easy test code in mbed that work, I will try to replicate in flowcode, I hope to have success so I can go on with flowcode.


I have also another code in mbed that activate "quadrature encoder" encoder hardware reading feature, is it possible to do the same in flowcode ?


I included the code as example


Thank you !

Sacha

Code: Select all


InterruptIn ZPulse(PA_4) ; 

 
void EncoderInitialise(void) {
    // configure GPIO PA0 & PA1 as inputs for Encoder
    RCC->AHB1ENR |= 0x00000001;  // Enable clock for GPIOA
 
    GPIOA->MODER   |= GPIO_MODER_MODER0_1 | GPIO_MODER_MODER1_1 ; 

    GPIOA->OTYPER  |= GPIO_OTYPER_OT_0 | GPIO_OTYPER_OT_1 ;         
    GPIOA->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR0 | GPIO_OSPEEDER_OSPEEDR1 ;
    GPIOA->PUPDR   |= GPIO_PUPDR_PUPDR0_1 | GPIO_PUPDR_PUPDR1_1 ; 
    GPIOA->AFR[0]  |= 0x00000011 ;   
    GPIOA->AFR[1]  |= 0x00000000 ;
   
    // configure TIM2 as Encoder input
    RCC->APB1ENR |= 0x00000001;
    TIM2->CR1   = 0x0001; 
    TIM2->SMCR  = 0x0003;
    TIM2->CCMR1 = 0xF1F1;
    TIM2->CCMR2 = 0x0000;
    TIM2->CCER  = 0x0011;
    TIM2->PSC   = 0x0000;
    TIM2->ARR   = 0xffffffff;
  
    TIM2->CNT = 0x0000; 
}

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: Presentation and some consideration on Pin problems

Post by LeighM »

Hi Sacha,

Your EncoderInitialise() C function would certainly compile into a Flowcode project,
you would just need to drop this into the Build->Project Options->Supplementary Code.
Functions can then be called from C code in a C code Flowcode icon.

However, if you are starting out with Flowcode you will probably be better starting with a new project using Flowcode only icons.
Integrating C code into Flowcode can be more tricky.

Post Reply