Architecture advice please?

Discuss PC Developer and Web Developer projects and features here.
jan.didden
Posts: 82
http://meble-kuchenne.info.pl
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Architecture advice please?

Post by jan.didden »

Time for full disclosure ;-)

I currently have a piece of equipment that runs on a PIC16/PIC18, running an LCD display, a couple of pushbuttons, some LEDs, a relay board and reads an anolog input. It's a few years old design and the software, developed with successive versions of Flowcode, is mature.
It needs an ADC input and 20 digital I/O's, a 12 bit ADC with external reference.

I want to extend this unit with WiFi/BT, Ethernet and USB connectivity, to allow external readout and control. Also want to upgrade the LCD display to a small graphic color display. I've been looking at the ESP32 family as they offer WiFi/BT/Ethernet modules. But the available modules and combinations are overwhelming for someone new to ESP. So please give me some advise. I have identified a couple of ways forward which may or may not make sense:

1 - stay with the PIC with its USB connectivity and add some external module like the ESP32 WROVER which adds WiFi/BT and maybe Ethernet, not sure, probably this needs a PHY add-on board? Must be FC9 or FC10 compatibe;

2 - at the other end of the choice range, go for an ESP32-Ethernet-Kit which has WiFi. BT, Ethernet and USB, but the disadvantage is that there's only a very limited set of free use I/Os and is quite expensive.

I'd rather stay with option 1, but I am confused about which module is exactly supported by the listed modules in the Flowcode communications pack.

Would appreciate any pointers to get me on the best way forward!

Jan Didden

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: Architecture advice please?

Post by mnfisher »

There are alternative esp32 setups with Ethernet e.g. https://www.olimex.com/Products/IoT/ESP ... e-hardware but support in flowcode is probably not there at present.

Would a discrete port expander / adc also be useful add-ons?

Martin

jan.didden
Posts: 82
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: Architecture advice please?

Post by jan.didden »

Hi Martin, yes that could be an option; I'm not fond of throwing chips at the problem, but certainly feasible.
Are you suggesting a Wifi etc enabled and Flowcode supported ESP board with external port expander and an ADC added?

BTW That boardlet you linked to, incredible, $ 16 for a complete system, how do they do that??

Jan

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: Architecture advice please?

Post by mnfisher »

Hi Jan,

As a possibility, yes. The Olimex board uses an esp32-wroom board so should well work with Flowcode. If you need more IO - add an extra IC - the Olimex boards are open-source so it would be theoretically possible to mod it.

Flowcode does support the wifi and bluetooth (only 'Classic' - not BLE yet - although I've posted a bit about using this) - not sure about the ethernet port. It is possible to link external code (in C from the Espressif (maybe also Olimex) codebase) into your program - to use extra 'features' like this (rather than rewriting from scratch). The esp32 does have a builtin ADC - which may be sufficient?

How easy / expensive is it to add wifi etc to the current PIC setup (which has the advantage of being stable with code too!)

Martin

jan.didden
Posts: 82
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: Architecture advice please?

Post by jan.didden »

BTW, does anybody know whether Flowcode supports REST API's ?

Jan

jan.didden
Posts: 82
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: Architecture advice please?

Post by jan.didden »

Martin, the current setup is a simple 16F886 that queries some pushbutton switches, runs some relays and LEDs and displays among other things an analog input signal. https://linearaudio.net/sites/linearaud ... rmance.pdf
Adding this new functionality will be much more involved than the basic unit, so I should anyway move to a new processor etc.
The basic app is not very specific so should find an easy home in whatever I will move to.
Are you familiar with REST API? That was suggested as it seems to proliferate rapidly in the type of test equipment I am targeting.
See for instance https://github.com/QuantAsylum/QA40x/wiki/QA40x-API .
I look into the Olimex in more detail. The ADC doesn't have to be very accurate, 12bits would be enough, low speed.
There is also no need for vast amounts of memory.

Jan

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Architecture advice please?

Post by chipfryer27 »

Hi Jan

Following on from Martin (whom is a "goto" guy for ESP) a possible alternative could be to use another PIC with two UARTS. One could connect to an ESP32 and the other to an ENC28J60. Both modules are supported in FC and would give you WiFi/BT/Ethernet connectivity.

Sorry to be brief.

Regards

EDIT
PS
Just realised you posted in App Developer which suggests you are intending to connect to a PC (via WiFi / USB etc). Maybe I've missed something (probably :) ) ?

jan.didden
Posts: 82
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: Architecture advice please?

Post by jan.didden »

Yes the idea is to connect not specifically to a PC but to another piece of equipment via REST API, using Wifi and Ethernet. Not sure about BT.
QuantAsylum (who comes up with these names anyway??) would be one potential user, but there are others basically PC software based. https://github.com/QuantAsylum/QA40x/wiki/QA40x-API .
I have no idea whether these things like cURL can be embedded in a FC chart as C statements, that it is supported by the FC C compiler. So much to check, so little time ;-)

Jan

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Architecture advice please?

Post by chipfryer27 »

Hi Jan

I've certainly used GET to connect with PushingBox / ThingSpeak etc so hopefully you can connect to your kit.

Regards

jan.didden
Posts: 82
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: Architecture advice please?

Post by jan.didden »

What do you guys think about LabView? It seems to me that if you want to create the possibility to interface hardware with dissimilar interfaces, LabView could be a fast and flexible solution.
An autoranger with USB, a QA403 with either USB or REST API, etc. It can easily be interconnected as long as you can define the interface functions.

Jan

Post Reply