Page 1 of 2

How to expand IO capability of Arduino in LattePanda

Posted: Mon Jan 02, 2017 9:42 am
by resonanceshah
Hi,

I would like to expand the IO capability of the Arduino using SPI (preferably) or I2C communication and further access the variable holding the IO status in VB.Net ... Can anyone pls guide if this is possible to do. I am not sure if Lattepanda has SPI capability. Moreover all info I get online are how to access the digital & analog IO pins. Can variables be accessed in any way.

Thanks

Re: How to expand IO capability of Arduino in LattePanda

Posted: Mon Jan 02, 2017 10:45 am
by Lutz

Re: How to expand IO capability of Arduino in LattePanda

Posted: Mon Jan 02, 2017 11:00 am
by resonanceshah
Hi Lodin,

Thanks for the reply, but like I mentioned most documentation only mentions how to access digital I/O. What I need to do is expand the I/O range by having IO chips connected to arduino using SPI or I2C. Further their status shall be stored in a variable. This variable is to be further read into VB.Net. I am not sure if this is possible. Also, is SPI possible on the LattePanda Arduino.

Re: How to expand IO capability of Arduino in LattePanda

Posted: Mon Jan 02, 2017 11:41 am
by Lutz
Hi resonanceshah,
(Google translator)
OK, something more in detail:
You need a software on the Arduino Leonardo to read and write the data via the SPI and to communicate with the PC to transfer the data via USB. Examples should be found on the Arduino page.

Then you need on the PC a second software for communication with the Leonardo, which collects the data via the USB. Because there is no direct connection between the ARDUINO pins and the PC on the LP board.

There is a connector (U1 http://www.lattepanda.com/docs/#Hardwar ... ccessories) with a serial interface and three I2C interfaces connected directly to the CPU. But their signals have 1.8V level, so you need level shifter IC and the occupancy in the picture is WRONG! The serial interface is the COM1 in Windows and I have already used.
But there is NO information on how to address the I2C although we have been waiting for a long time! :cry: :twisted:

Re: How to expand IO capability of Arduino in LattePanda

Posted: Mon Jan 02, 2017 3:40 pm
by resonanceshah
Dear Lodin

Are you sure there wud be no way to access arduino directly without having to go via USB as there are VB codes available to access digital and analog I/O pins directly. It seems like there would be some direct wiring between the pc and arduino else how cud they access these pins via VB.

Also leonardo by itself does support SPI... so shouldn't it be possible from lattepanda too?

Re: How to expand IO capability of Arduino in LattePanda

Posted: Mon Jan 02, 2017 4:13 pm
by Lutz
resonanceshah wrote:
(...)
as there are VB codes available to access digital and analog I/O pins directly.
(...)
Can you show some examples or links to them ?

Re: How to expand IO capability of Arduino in LattePanda

Posted: Tue Jan 03, 2017 5:36 am
by resonanceshah
The link sent by you itself has it.

http://www.lattepanda.com/docs/#How_to_ ... ual_Studio

Wouldn't this give us access to the digital and analog I/O of the arduino?

Re: How to expand IO capability of Arduino in LattePanda

Posted: Tue Jan 03, 2017 12:52 pm
by Lutz
resonanceshah wrote:The link sent by you itself has it.

http://www.lattepanda.com/docs/#How_to_ ... ual_Studio

Wouldn't this give us access to the digital and analog I/O of the arduino?
Not directly.

Did you google for "Firmata" to look what it is?

What do you think what http://www.lattepanda.com/docs/#SetuptheArduino "3.Select your COM port" means?

... and you have to use in your PC software a Constructor
"public Arduino (string serialPortName, Int32 baudRate, bool autoStart, int delay);"
( that is C#, but VB should look very similar)

A deeper look in the device manager then shows the COM3 as a virtual port, which comes from the USB.

I'm still waiting for the wiki promised by LattaPanda :twisted: ,
then I make a schematic drawing.

Conclusion (for me):
The https://www.arduino.cc/en/Main/ArduinoBoardLeonardo has a USB interface for communication.
This is connected to the USB of the LP.
A driver makes this USB visible as a virtual serial port (COM3, unfortunately sometimes also COM5 or another!) In Windows.
The PC software can also appeal to this interface like any other serial.
It requires software on the Leonardo as well as on the PC for the communication protocol via the interfaces.
This software is ready for the Leonardo.
For the PC as a software source.

Re: How to expand IO capability of Arduino in LattePanda

Posted: Thu Jan 05, 2017 6:48 am
by resonanceshah
ok that makes sense ... Thanks for your revert. I presume even the RX/TX cannot be accessed by VB directly right to communicate with some device serially? So for ppl like us who need access to more I/O (around 60) probably going for some other solution may be better?

Re: How to expand IO capability of Arduino in LattePanda

Posted: Thu Jan 05, 2017 8:34 am
by Lutz
resonanceshah wrote:ok that makes sense ... Thanks for your revert. I presume even the RX/TX cannot be accessed by VB directly right to communicate with some device serially? So for ppl like us who need access to more I/O (around 60) probably going for some other solution may be better?
Hello resonanceshah,

I assume, if you want to use the TX / RX interface, you plan to use your own circuit board?
Then why not using the COM1 from the LP, without the onboard Arduino?
You may need a level shifter IC like the MAX3373, because the signal at U1 (LINK) only have 1.8V level.

Here is a photo with a section of my circuit board:
COM1_PCB__004.jpg
COM1_PCB__004.jpg (238.53 KiB) Viewed 7382 times
One can clearly see at the wires, the occupancy in the documentation is unfortunately not correct !

Screenshot from LP, using terminal program "Docklight" to test the connection.
Screen_COM1_001t.JPG
Screen_COM1_001t.JPG (165.04 KiB) Viewed 7382 times
@LATTEPANDA : Documentation of U1 is still incorrect and we are also waiting for examples using the I2C on U1 !