Search found 923 matches

by mnf
Sat Feb 06, 2021 3:09 pm
Forum: Flowcode V8
Topic: Convert Int to a decimal number
Replies: 4
Views: 194

Re: Convert Int to a decimal number

Sorry - not at computer now.. but is your value a float?

Just looked and it's an integer value - you'll need a floating point value for your result...

Martin
by mnf
Fri Feb 05, 2021 8:43 pm
Forum: Flowcode V8
Topic: Convert Int to a decimal number
Replies: 4
Views: 194

Re: Convert Int to a decimal number

In a calculation use:

str = FloatToString$(value, 2) (or change 2 to required number of digits...)

Then print str.. (str defined a string variable..)

Martin
by mnf
Fri Feb 05, 2021 7:36 pm
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 349

Re: Receive string uart rs232

Glad to hear you got it working. That bar graph - graduated display looks great!

This forum doesn't have a specific section - I've posted stuff in the 'hints and tips' section....
The new v9 forum has a specific area https://www.flowcode.co.uk/forums/viewforum.php?f=10

Martin
by mnf
Wed Feb 03, 2021 12:49 pm
Forum: General Programming
Topic: how to set or clear individual bits in a veriable??
Replies: 3
Views: 433

Re: how to set or clear individual bits in a veriable??

One way to do it is with '|' (or operator) or to clear bits '&' (and operator)

Code: Select all

x = x | (1 << 4)
will set bit 4

Code: Select all

x = x & ~(1 << 4)
will clear bit 4

To set a 'variable' bit

Code: Select all

x = x | (1 << n)
To set or clear multiple bits you can use a mask

Code: Select all

x = x | 0b11110000
will set bits 7..4

Martin
by mnf
Wed Jan 27, 2021 12:13 am
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 349

Re: Receive string uart rs232

A couple of ideas to try... In the first program: The max string length is limited to 10 chars (receive_pos = (receive_pos + 1) % 10 - receive_pos will go from 0..9 then back to 0 - so increase the 10 to allow for max length of string - might need to increase size of buffer (Data_string) too. What i...
by mnf
Tue Jan 26, 2021 1:19 pm
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 349

Re: Receive string uart rs232

Hi Ronny,

Can you post your code to date? - and I'll try and see why it's just getting the tail of the string...

Martin
by mnf
Sun Jan 24, 2021 6:54 pm
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 349

Re: Receive string uart rs232

Hi Ronny, The isCharWaiting function doesn't really have an equivalent in FC - what to do is to have an Rx interrupt that puts received characters into a circular buffer (either the FC component or a simple array and counter) There are examples here https://www.matrixtsl.com/mmforums/viewtopic.php?f...
by mnf
Mon Jan 18, 2021 8:00 pm
Forum: Feature Requests
Topic: Fast display ST7789!
Replies: 83
Views: 4412

Re: Fast display ST7789!

Progress - so far...

See https://youtu.be/1rtbY4XN9Tc

Martin
by mnf
Tue Jan 12, 2021 7:16 pm
Forum: Bug Reports
Topic: Clock setting
Replies: 3
Views: 222

Re: Clock setting

Thanks, yes it didn't seem to cause a problem - and gone in v9...

Martin
by mnf
Tue Jan 12, 2021 9:05 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 225

Re: Maximum String Length for 16 and 32-bit PICs

Something like: senddata.JPG Where data (an array - you can use any value in the parameter definition, data[2] for example - and then pass any size array (data[10000]). Also pass the length - as mentioned this will allow data arrays (including 0) - if you want to use strings (0 is termination charac...
by mnf
Tue Jan 12, 2021 8:56 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 225

Re: Maximum String Length for 16 and 32-bit PICs

Looking at the code generated... void FCD_05481_cal_uart__SendString(MX_CHAR *FCL_DATA, MX_UINT16 FCLsz_DATA) { //Local variable definitions MX_UINT8 FCL_IDX; MX_UINT8 FCL_LEN; So - in FC8 at least you will be limited to a maximum of 255 characters if you use SendString. Note this seems to be fixed ...
by mnf
Tue Jan 12, 2021 7:42 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 225

Re: Maximum String Length for 16 and 32-bit PICs

Are you actually sending a string or an array of data?

- in a string 0 marks the end of string. If it was an array of data then 0 might be a valid value - and you would typically also pass a length to.

Martin
by mnf
Tue Jan 12, 2021 6:39 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 225

Re: Maximum String Length for 16 and 32-bit PICs

Hi Brendan, Have a look at the c generated - if there is a X = str_len(str) type statement or an index while (str[X])... then the max length will be determined by the size of this and other variables if x is 8 bit then 255 characters is probably your lot. It would be easy to write a new routine usin...
by mnf
Mon Jan 11, 2021 4:32 pm
Forum: Bug Reports
Topic: Clock setting
Replies: 3
Views: 222

Clock setting

A visual bug. Using an ATTiny MCU (I tried 88 and 22 others maybe affected too) - set the clock speed to > max speed (so for I tried 16 and 32MHz) - this (correctly) says 'greater than max speed' - but then displays the 'loading targets' with whirly. This stays until clicking 'cancel' which gets rid...
by mnf
Mon Jan 04, 2021 8:00 pm
Forum: Flowcode V8
Topic: Referencing a ROM table in a C block
Replies: 3
Views: 169

Re: Referencing a ROM table in a C block

No problem...

Martin
by mnf
Mon Jan 04, 2021 7:21 pm
Forum: Flowcode V8
Topic: Referencing a ROM table in a C block
Replies: 3
Views: 169

Re: Referencing a ROM table in a C block

Hi Brendan,

The easiest way to check this is to define some code that does it and then look at the C generated..

For example in a calculation I do :

Code: Select all

.x = lut1::GetInt(2)
This 'expands to' (using customize C code or view C)

Code: Select all

FCL_X = FCD_00fb1_lut1__INTLIST(2);
Martin
by mnf
Mon Jan 04, 2021 6:20 pm
Forum: Programming Tips & Tricks
Topic: Recursion in Flowcode
Replies: 3
Views: 4158

Re: Recursion in Flowcode

Currently reading 'Algorithms Illuminated' by Tim Roughgarden - and first algorithm I tried to implement in Flowcode was Quicksort. This is a great sorting algorithm - quick (as the name suggests) and also light on memory use (although it can use a fair bit on recursion calls...) So - using a very n...
by mnf
Mon Dec 28, 2020 7:18 pm
Forum: Flowcode V8
Topic: Memory 24C64
Replies: 2
Views: 285

Re: Memory 24C64

I did a simple component for an i2c eeprom eeprom.fcfx - Which I've modified and used extensively since I posted it (above is a copy of the last posted version... (It's simplest and program rather than a component)) It should be fairly straightforward to get it to work with the 24c64 chip (note this...
by mnf
Sat Dec 26, 2020 6:11 pm
Forum: Bug Reports
Topic: ATTiny85 SPI
Replies: 8
Views: 493

Re: ATTiny85 SPI

Hi Ben,

Hope you had a good Christmas - any progress on this - it seems to affect all the chips with the USI interface.

Martin
by mnf
Thu Dec 24, 2020 6:47 pm
Forum: Flowcode V8
Topic: Merry Christmas!
Replies: 11
Views: 602

Re: Merry Christmas!

Wishing everyone a merry Christmas and hoping that 2021 is a prosperous and happy New year.

I think Martin's house looks the cosiest...

Martin
by mnf
Wed Dec 23, 2020 2:43 pm
Forum: Flowcode V8
Topic: Login FC9!
Replies: 14
Views: 974

Re: Login FC9!

The flowcode password doesn't seem to be properly linked to the forum password.. I changed mine for the matrix site - but the old password still works on the v9 forum.

Martin
by mnf
Fri Dec 18, 2020 7:32 pm
Forum: Feature Requests
Topic: Fast display ST7789!
Replies: 83
Views: 4412

Re: Fast display ST7789!

So many displays (or is it display drivers?)

Will have a look and see - what features would you like to see though
d.. it :(
- good advice for holes in the socks?

Martin
by mnf
Fri Dec 18, 2020 12:27 pm
Forum: Flowcode V8
Topic: SSD1963 hardware not working properly
Replies: 43
Views: 2471

Re: SSD1963 hardware not working properly

No worries. If you change your mind then PM - but hopefully Matrix can get things up and running for you. I'd experiment - but without something to test on it's not an easy ask. There are a lot of good screens that are easy to use and work with - so if you are needing to get something working quickl...
by mnf
Fri Dec 18, 2020 11:47 am
Forum: Flowcode V8
Topic: SSD1963 hardware not working properly
Replies: 43
Views: 2471

Re: SSD1963 hardware not working properly

As I offered with another display - if you supply me with the hardware - I'll try and get something working.

As it's a commercial project then payment would be good.

I've 'done' a component for ST7789 so have some experience with displays.

PM if you are interested..

Martin
by mnf
Fri Dec 18, 2020 7:40 am
Forum: Flowcode V8
Topic: Sitronix ST7586
Replies: 6
Views: 469

Re: Sitronix ST7586

Hi Clive, If you send me a display - I'll try and get it working. I've just been working with the st7789 and got it to work pretty well... I can return it when done. If you're interested I'll pm you my details Note I'm only offering basic functionality so no simulation . But see the st7789 topic. I ...