Search found 25 matches

by Kisen
Wed Jun 03, 2020 9:30 am
Forum: Flowcode V8
Topic: Hardware I2C on STM32
Replies: 5
Views: 76

Re: Hardware I2C on STM32

Thanks Leigh,

I will try these out and come back to you if i have any issues.
by Kisen
Tue Jun 02, 2020 12:15 pm
Forum: Flowcode V8
Topic: Hardware I2C on STM32
Replies: 5
Views: 76

Re: Hardware I2C on STM32

Hi,

The processor is an STM32F411CCU6
by Kisen
Mon Jun 01, 2020 11:55 am
Forum: Flowcode V8
Topic: Hardware I2C on STM32
Replies: 5
Views: 76

Hardware I2C on STM32

Hi,

I have recently purchased flowcode and there doesnt seem to be an option for hardware I2C on the STM32.

Software I2C isnt fast enough for my application.

Is this something you will be adding soon or is it just being left out indefinitely?
by Kisen
Mon Mar 30, 2020 2:14 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Hi, I have so far been using the following union to reassemble my floating point data. FloatUnion.AsByte[0] = FCV_TEMP_UNION_STR[0]; FloatUnion.AsByte[1] = FCV_TEMP_UNION_STR[1]; FloatUnion.AsByte[2] = FCV_TEMP_UNION_STR[2]; FloatUnion.AsByte[3] = FCV_TEMP_UNION_STR[3]; FCV_TEMP_UNION_FLOAT = FloatU...
by Kisen
Fri Mar 20, 2020 7:26 pm
Forum: Flowcode V8
Topic: STM32 how much memory and RAM left upon compiling?
Replies: 1
Views: 399

STM32 how much memory and RAM left upon compiling?

Hi,

Is there a way to see how much RAM and memory space has been used up when compiling on the STM32 ICs?
by Kisen
Thu Mar 19, 2020 5:31 pm
Forum: Flowcode V8
Topic: STM32F411 STOP MODE
Replies: 4
Views: 404

Re: STM32F411 STOP MODE

Hi Leigh,

Your reply has just confused me even more.

You suggest to call the function in C. Thats not a problem.
But where is flowcode getting the instructions from to set and clear the registers as per the code i quoted?
Is this HAL library already built into flowcode??
by Kisen
Thu Mar 19, 2020 5:08 pm
Forum: Flowcode V8
Topic: STM32F411 STOP MODE
Replies: 4
Views: 404

Re: STM32F411 STOP MODE

I have found the function that is called to set the STM32 into stop mode. Unfortunalty, I appear to have zero clue on how to implement this in Flowcode in a C block. Has anyone got any pointers? void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry) { /* Check the parameters */ assert_par...
by Kisen
Thu Mar 19, 2020 1:18 pm
Forum: Flowcode V8
Topic: STM32F411 STOP MODE
Replies: 4
Views: 404

STM32F411 STOP MODE

Hi, Does anyone have any experience using the sleep modes on STM32. I have read and watched several videos on this, but they all seem to relate to a HAL function. In flowcode is this something i need to create? Also when exiting sleep mode it appears that some code is required to reactivate the chip...
by Kisen
Sun Feb 09, 2020 10:33 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Change your union to: typedef union { float AsFloat; MX_UINT8 AsByte[4]; } MX_FloatUnion; MX_FloatUnion FloatUnion; Assign the value to AsFloat and get the bytes from the 4 AsByte vast like your earlier example. Hi, Thanks for this. It works perfectly now. Whats the difference between the 'MX_FLOAT...
by Kisen
Sun Feb 09, 2020 2:39 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

kersing wrote:You could try to use float for the union member in stead of the MX_FLOAT. That should result in a 4 byte float.


I'm not sure what you mean by this. Could you give more info please?
by Kisen
Sun Feb 09, 2020 2:38 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

So - you want to convert the value to a 32bit integer (rather than a 32bit float)? What range of values are you working with and how many points of accuracy do you need? Taking the byte 'values' of the fp number isn't the way to go here (it would be possible - but difficult) Could you - for example...
by Kisen
Sat Feb 08, 2020 9:41 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

I just found this on the matrix wiki. A floating point value can represent a much wider range of values than an integer can, but at a loss of accuracy over large ranges. Floating point values when downloaded will be 64-bit if the target supports them, or 32-bit if it does not. Seems that's why I am ...
by Kisen
Sat Feb 08, 2020 8:53 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

If they are 64 bit then change byte array to 8 bytes (and the loop in FloatToByte) If the values are 32 bit the last 4 bytes will be junk... Martin At first I thought that to be the case. But it seems they arent junk. They are actually 64bit values. So the Union works for me and does as it should. ...
by Kisen
Sat Feb 08, 2020 8:25 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Thanks Martin for the example. Seems that your floats are converting on the assumption they are 32bit. I wonder why mine are double floating point? I was under the impression they were 32bit until Leigh said they were Doubles. Is it because i am using ARM do you think?? I am pleased i have it output...
by Kisen
Sat Feb 08, 2020 8:14 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

You added 4 bytes and read 8 into byte sized variables but your samples still show just 4 bytes worth of bits. Shouldn’t you look at 8 bytes and print the value of all 8? So following your comment i thought it a good idea to actually see if there was data in the first 4 bytes. Turns out there is an...
by Kisen
Sat Feb 08, 2020 6:42 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

The previous posts say that the float is a double containing only a 32 bit float value. So the first 4 bytes are all zero. So i read them, but i dont use them for anything as they just contain zero's
by Kisen
Sat Feb 08, 2020 11:54 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

OK, This is interesting, But i dont know what to do with the information... The Original value of 22.694473 Which has a bit code like this. 01000001101101011000111001001000 This is the bit code that i get from my outputs: 01000000001101101011000111001001 They look different and give a different valu...
by Kisen
Sat Feb 08, 2020 11:39 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

I have added the other 4 bytes to the Union, to give me this. typedef union { MX_FLOAT AsFloat; MX_UINT8 AsByte[8]; } MX_FloatUnion; MX_FloatUnion FloatUnion; FloatUnion.AsFloat = FCV_FLOATTOBYTE; FCV_F0 = FloatUnion.AsByte[0]; FCV_F1 = FloatUnion.AsByte[1]; FCV_F2 = FloatUnion.AsByte[2]; FCV_F3 = F...
by Kisen
Tue Feb 04, 2020 10:52 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

The float is a double, so it’s 8 bytes. Not sure if that explains the 0, but might be worth printing all 8 bytes That has confused me a little. A float is a 32bit value is it not? If the float is a double then it would surely contain data in the first 4 bytes since this is where the sign bit and 11...
by Kisen
Tue Feb 04, 2020 9:46 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

The outputs from those calculations are all outputting as expected.
I already convert these to strings and output them on the UART to verify them.
by Kisen
Mon Feb 03, 2020 5:36 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Hi,

I have attached the file for the program i am working on.
by Kisen
Mon Feb 03, 2020 11:53 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Hi Here is the code i am using. Supplementary Code: typedef union { MX_FLOAT AsFloat; MX_UINT8 AsByte[4]; } MX_FloatUnion; MX_FloatUnion FloatUnion; Main Code: FloatUnion.AsFloat = FCV_FLOATTOBYTE; FCV_F0 = FloatUnion.AsByte[0]; FCV_F1 = FloatUnion.AsByte[1]; FCV_F2 = FloatUnion.AsByte[2]; FCV_F3 = ...
by Kisen
Tue Jan 28, 2020 6:09 pm
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Thanks Ben for the link to the C version.

I have followed this and have also found other C examples in the forum.
In my case the values being written to the bytes are all zero. Even if i preload the byte with a value it is overwritten by the C code to zero.

Any ideas why this is?
by Kisen
Fri Jan 24, 2020 11:35 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

Re: FLOAT to INT and back again.

Hi Benj, I am just using the evaluation 30 day version of V8. So i assume i just feed my float value into the component and it spits out a 32bit value? If i wanted to do this in C how would it be done? I only ask as i see that each of the different modules cost when purchasing to a full license. So ...
by Kisen
Fri Jan 24, 2020 10:53 am
Forum: General Programming
Topic: FLOAT to INT and back again.
Replies: 33
Views: 2275

FLOAT to INT and back again.

Hi, I have found myself facing a problem. I have a device performing some calculations where the outputs of those calculations are floating point variables. I need to send those variables via UART to a radio device where the information will be received by a webserver. If i were keeping the readings...