Separate the Spark from the Arduino?

Hi Guys,

I have been reading a few things on the forum and started to notice a common problem as it seems the Arduino side is completely dependent on the WiFi side and visa versa

Looking at something like the LightBlue Bean it appears they have separated the BTLE modules from the Arduino allowing them to run separately and thus avoiding requirements to avoid too many large delays etc.

I think this also gives a great ability as the WiFi module could stay connected the entire time your flashing the Arduino etc

Have I missed a design concept of the Spark Core/Photon or is this possible to implement in the Photon?

If it was possible to separate the Spark from the Arduino (leaving just a bridge) then it would open the Spark to being sold as a WiFi module that can be added to any Arduino system (eg. bigger/smaller chips designed for the specific purpose of a project)

Thanks!

I believe you misunderstand what the Spark Core is. The Core is an arduino-like system based on the CC3000 WiFi module and a STM32 cpu. It doesn’t actually contain an Arduino chip, which is typically the ATMega328 chip, as used on the Arduino Uno.

The CC3000 does run separately from the STM32, and so it is possible to have a system with no delays form network activity. However, the driver code provided by TI for the CC3000 is a blocking, synchronous driver, which introduces delays in some circumstances.

Also keep in mind that a non-blocking implementation would require a different programming model, which would break compatibility with the existing Arduino Wiring APIs.

4 Likes

I understand that the Spark is not an Arduino in the sense of the chips etc, however what I was trying to propose was to separate the Spark systems from the user code on STM32.

For example if I put a delay(10000) into the Sparks user code it will break the spark systems and require a reset to re-establish the connection etc.

If the Spark was separated from the STM32 and used a bridge to interconnect, then should the user code fault or get hung, the Spark its self would remain connected to the cloud and be functional for an OTA update etc

I do understand this could be a complex task given the need for user code to have access to the TCP/UDP stacks unlike the Bean which is generally only serial communications, however if it was possible I think it would make the platform much easier to use in certain circumstances

Hopefully this clears up my original question?

So I think I can see what you are asking for–maybe one of the Spark guys can comment, but I don’t think they can be easily separated.

One misconception in your post above is about using delay(). Calling delay(10000); works fine now because delay has been rewritten to service the cloud connection during the “spare” time. This lets a lot of Arduino code just work.

Hi,

I think you are talking about a Photon, it is supposed to support running of local code and wifi. It is not a bridge so much, it is the OS, based on a multitasking environment. I don’t have all the details but there are plenty of posts on this in the forums. I write all my code as non-blocking and also toggle an output pin in my code at regular intervals if the code stops external circuitry takes the Spark-Core out of the loop and runs manual mode until the Spark comes to life.

Best regards,
Clive.