Interface board for Flowcode V8 and above. Now added RTC

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Interface board for Flowcode V8 and above. Now added RTC

Post by medelec35 »

The interface board enables Flowcode simulator to work really well with actual hardware.
It is possible to test hardware is working as expected, without programming any target devices, each time a change is made.
You don’t send the flowchart to the interface board either!
You can observe all the commands sent two and from Flowcode & hardware on the console.
The interface board is available from here
The interface board is compatible with all embedded targets!
I will be using two lots of hardware to demonstrate with the USB version of interface board.
LCD with I2C backpack & Wii nunchucks.
If you have a LCD I2C backpack then just connect the LCD backpack to 5v supply and I2C SDA/SCL connections of the interface board.
Make sure switch on the interface board is selected for 5V & the jumper is going across LED 2 pin header.
I used DuPont female to female connections as I have got an interface board with all the male headers soldered on to it.
Plug the USB into the interface board and PC then load Run Flowcode.
Load the attached I2C Backpack LCD.fcfx
Within Flowcode select View Console and select Interface Board.
You can just run the simulation or single step by pressing F8.
The console will display com port that is connected to the interface board.
The brightness of the status LED will be dim except when commands are being sent or received, then will flash much brighter.
The hardware should match the simulation:
Interface Board with I2C Backpack LCD.png
Interface Board with I2C Backpack LCD.png (529.76 KiB) Viewed 2698 times
As there is no hardware to program you can modify the flowchart then run the simulator again.
You will see all the changes on the hardware LCD.
Unplug USB.

Nunchucks:
IMPORTANT: MAKE SURE THE VOLTAGE IS SET AT 3V3
Connect nunchucks to the power and I2C of the interface board.
Plug in the USB then Run Flowcode & load the Nunchuk_InterfaceBoard With LCD.fcfx flowchart.
After selecting Run, I’m now moving the nunchucks is different directions, holding down button C and pushed the joystick to the left.
As I moved the hardware, the Flowcode simulator match perfectly:
Wii Nunchucks.png
Wii Nunchucks.png (82.76 KiB) Viewed 2698 times
Now I know without sending code to any targets, that my hardware will work.
If for some reason the hardware does not work with simulator then check the device manager for the USB serial device and what port its connected to:
Serial USB.png
Serial USB.png (3.88 KiB) Viewed 2698 times
Next select properties of Serial board on the 2D panel & change AutoDetectPort from Yes to no.
Make sure correct com port is shown.
The com port is also shown on console at the very top interface board data.

If you are interested in how Ben created the interface board (both hardware and firmware) then check this out, Very interesting!
On that page you will also find examples for GLCD's and MPU950 accelerator, gyroscope, and digital compass (magnetometer).
Along with firmware source code

Drivers for the board can be found here
Driver was not required for my interface board to work.

Many thanks to Ben for creating & getting all the hardware and Flowcode to work together, he has done an amazing job.
Attachments
Nunchuk_InterfaceBoard With LCD.fcfx
(23.22 KiB) Downloaded 60 times
I2C Backpack LCD.fcfx
(12.03 KiB) Downloaded 64 times
Martin

stefan.erni
Valued Contributor
Valued Contributor
Posts: 650
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 178 times
Contact:

Re: Interface board for Flowcode V8 and above

Post by stefan.erni »

Hi Martin

Thats a good news thanks a lot.
I have placed an order.
one more little question.
Do you know the difference between:
Embedded Interface Board I2C SPI PWM ADC DAC Servo (WIFI Slave)
Embedded Interface Board I2C SPI UART PWM ADC DAC Servo (USB Slave)

regards

Stefan

User avatar
Benj
Matrix Staff
Posts: 15195
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4761 times
Been thanked: 4296 times
Contact:

Re: Interface board for Flowcode V8 and above

Post by Benj »

Hi Stefan,

The USB slave connects to the controller PC using USB.
The WIFI slave connects to the controller using WIFI (ESP8266) allowing say the embedded functionality to be controlled from a networked device, mobile device or the internet. The WIFI module connects via the UART and hence that is no longer available.

Both firmware versions are available on the github link and can easily be swapped using a PICkit.

Many thanks to Martin for such a glowing product review :D

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above

Post by medelec35 »

Hi Stefan,
Your welcome.
I'm finding the board so handy.
No more recompiling after further flowchart changes is brilliant!

Thanks Ben,
I was so impressed with its functionality,
I thought writing a bit about it was the least I could do!
It's my go to board for all my future projects, before I even choose a target device. :lol:
Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above

Post by mnf »

Yes - that looks very interesting... Ordered a couple to try..

Thanks Ben... (& Martin for drawing our attention to it..)

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above

Post by medelec35 »

Thanks and You're welcome Martin.
I found it interesting.
Going to try multiple items connected.
E.g 2 or 3 x I2C + 1 x SPI.
Need to order more gLCD's :lol:
Martin

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above

Post by medelec35 »

Attached is a version for the DS1307, DS3231 & DS3232 Real Time Clock.
As soon as Flowchart is loaded, If not updated Flowcode (Help, check for Updates...) on or after 02/Oct/20 then you will need to run the update.

Only hardware required is the RTC and interface board (Set at 3V3).
When you run Flowcode simulation, it will read the RTC hardware to obtain the date and time.
If either the time or date is out, you have just received a new RTC module or you just replaced the battery, in which the time will default to:
Just replaced battery.png
Just replaced battery.png (13.23 KiB) Viewed 2546 times
All you do is select switch A0 until seconds stop incrementing.
As soon as you release the switch, the RTC module is automatically updated to the PC time and date:
RTC Updated.png
RTC Updated.png (12.6 KiB) Viewed 2564 times
You will end up with the correct time and date on your RTC module:
LCD RTC1.png
LCD RTC1.png (12.76 KiB) Viewed 2567 times
How good is that?
This will be a godsend if you have multiple RTC modules that require setting.
Note the Flowchart should also work with any target device without the interface board..
The switches are used to manually set time and date.
However that's the long way around of setting RTC!
Attachments
DS1307 RTC Tester & ProgrammerV1 Test.fcfx
(85.57 KiB) Downloaded 74 times
Martin

User avatar
AbhijitR
Posts: 205
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 204 times
Been thanked: 50 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by AbhijitR »

Hello! Martin, Hello! Ben
good morning

Thank you for the information, It looks interesting, how can I buy this product/card in India, any help.

Abhi

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by medelec35 »

Hi Abhi,
I have just checked for the ebay listing.
Postage is £2.20 for India, which is just under 209 Indian Rupee.
On the listing you will see Posts to:Worldwide See exclusions.
Select the See exclusions link and select India.
Hope this helps?
Martin

User avatar
AbhijitR
Posts: 205
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 204 times
Been thanked: 50 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by AbhijitR »

Hello! Martin
good morning

Thanks for the help, yes I am happy I could buy and also shipping to India is available, I will place an order for my Interface Board.

Abhi

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by mnf »

Arrived today.. Soldered one board up - but what's the default password for the Wi-Fi???

User avatar
Benj
Matrix Staff
Posts: 15195
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4761 times
Been thanked: 4296 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by Benj »

Hi Martin,

The instructions for setting up the WIFI are now listed on the readme page here. I've added the password too as that info was missing. :oops:
https://github.com/RowlandTechnology/Interface-Board

The default WIFI network should be "password" all lowercase.

Let us know how you get on.

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by mnf »

Hi,

Arrived today and looking good..

The password for the default wi-fi is 'password' - and there is an error in the instructions - 192.16.4.1 should read 192.168.4.1

Not sure where to go next - how do I get FC to talk to it via wi-fi??

Martin

User avatar
Benj
Matrix Staff
Posts: 15195
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4761 times
Been thanked: 4296 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by Benj »

Thanks Martin,

Good spot, getting that fixed now.

User avatar
Benj
Matrix Staff
Posts: 15195
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4761 times
Been thanked: 4296 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by Benj »

To talk to it via wifi you need to configure the Interface Board component properties like this.

Component is under API -> SCADA Slaves -> Interface Board

IntBoardWifi.jpg
IntBoardWifi.jpg (43.63 KiB) Viewed 2408 times

Change the network interface property until you get sensible values for the local IP of your machine.

Change the Board IP to match the module IP, you can do an auto scan to find the IP (takes a while) or you can refer to your WIFI router config page for the connected device list.

To control the interface board you can call the component macros directly or you can do what Medelec is doing and use SCADA Slave Injectors to catch I2C, SPI or UART data and forward to the interface board behind the scenes.

The Log mode property is best in Command Mode to allow you to see the comms in real time on the console window when running the sim.

Here's a quick example using a I2C enabled component.

I2C Demo.fcfx
(9.81 KiB) Downloaded 41 times

Hope this helps.

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by mnf »

Hi Ben,

Thanks - I'll have to play some more...

I got a ssd1306 oled display running on i2c (albeit slow - works - hoorah)

Haven't managed to get wifi going - boards don't show up as connected on router, not do they output their network (I entered details on the page!)
The auto-connect doesn't find them either.

The usb board - I noticed an oddity. The list of USB ports includes only the ports available when the sketch was loaded into flowcode. So if the board is plugged in then you can't select it (auto does work :-) ) Reloading the sketch makes the port available in the list.

The pins for BT connection - what order are they? I'm tempted to solder a header block so I can plug in a hc-05 if needed?

Martin

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by medelec35 »

Hi Martin,
glad you have got ssd1306 oled display running.
If you want to give the Wifi a try I can take you through setting it up step by step.
I have got my interface board working via Wifi, with help from Ben.
Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by mnf »

Yes, please, a walk-thru would be great.

Particularly what we need to add to code to make it work with the board. Slightly on the back-burner while I played with fingerprints - but I 'd try adding it to the dfplayer code in the first instance?.
(Ben kindly 'released' the code for the i2c oled display a while ago - which surely includes support - so I'll study that some more (plans for that too - time pressure is bad at the moment!))

Martin

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by medelec35 »

Power up interface board.
Scan for new Wifi connections, you should see one named InterfaceBoard.
Connect to it using password as the password.
When connected, on a browser enter address 192.168.4.1
You should get a prompt for SSID and your SSID password.
When entered details and Register, it will state ‘SSID and Password collected.
Connecting to SSID.’
If successful, then the wifi for InterfaceBoard should disappear, kicking you out of the connection.
You should only proceed to the next stage if you if cannot see the InterfaceBoard in available WiFi connections.
Check waht your IP address is by using powershell or command prompt and enter ipconfig.
With flowchart loaded, select the interface board properties from the panel.
Under Connection Properties for NetworkComms1::NetworkInterface you will need to select a number from the drop-down so that NetworkComms1::IPAddress shows as a valid IP address e.g. 192.168.0.43 i.e the value you get with ipconfig.
Mine works with number 5.
When that is done you can select the console and run the simulation.
If the Interface board tab is selected, the very first time of running you should see something like this:
Interface Board WiFi Setup.png
Interface Board WiFi Setup.png (28.96 KiB) Viewed 2324 times
Should all be set up once you see 1 Devices Found.
Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by mnf »

Thanks - yes that works!

I'd missed the Network Interface step (although I'd tried a couple of different values - just not the right one :-( )

So after a long search - board found at 245!

Brilliant!

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by medelec35 »

Hi Martin,
that's great!
Glad it's working on WiFi for you.
Thanks for letting us know.
Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1071
Joined: Wed May 31, 2017 11:57 am
Has thanked: 65 times
Been thanked: 414 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by mnf »

Hmm - sort of works..

Testing with i2c oled (which worked aok on usb) - the board sort of worked.

With a lot of LED flashing - the display cleared (mostly) and printed Hello World (also mostly)
But lots of corruption / missing pixels etc. Maybe a speed issue?
oled.jpg
oled.jpg (204.13 KiB) Viewed 2282 times
Martin

User avatar
Benj
Matrix Staff
Posts: 15195
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4761 times
Been thanked: 4296 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by Benj »

Thanks Martin, that's really interesting.

I'll investigate this and see if there is a way to improve the WIFI communications to make it a bit more solid like the USB.

jgu1
Posts: 1315
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1107 times
Been thanked: 295 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by jgu1 »

Hi all/Medelec!

Thank you, again a good tips and trick from you. Order one now :D

Jorgen

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9223
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2542 times
Been thanked: 3729 times
Contact:

Re: Interface board for Flowcode V8 and above. Now added RTC

Post by medelec35 »

Hi Jorgen,
Yore're welcome.
I love my interface board.
Especially with DS1307/DS32xx.
Makes setting time and date so easy.
I'm sure you also come to the same conclusion.
I don't get any commission on the board, just find it so useful.
Hence the reason for posting about it.
Martin

Post Reply