Arduino Use

Would you like to see more information or a tutorial about how to do something with LattePanda Alpha or Delta? Post requests here!

Moderator: ED209

Post Reply
User avatar
Isotope
Posts: 2
Joined: Wed Feb 27, 2019 5:10 pm

Wed Feb 27, 2019 5:17 pm

Forgive my ignorance, but I cannot find any tutorials over how to use the Arduino on the Alpha 864. I have used Arduino many times before, but I am unsure of a number of things on the Alpha 864.

(a) Is it as simple as writing code to the IDE and trying to upload straight to the board? Or do I need a cable or something?

(b) When should I connect jumpers to my breadboard? Are the Arduino specified pins always off on start up?

Sorry for the simple question, but I couldn't find a tutorial anywhere. Thanks!

User avatar
ccs_hello
Posts: 441
Joined: Sat Oct 13, 2018 9:16 pm

Wed Feb 27, 2019 11:10 pm

On a)

See the theory of operations related to on board Arduino Leonardo:
Let's dive deeper into the theory of operation....

Arduino Leonardo (ATMega 32u4) bootloader, out of factory (and every time the Arduino IDE is properly loading the code into the 32u4),
the CDC-ACM is part of the firmware, making itself look as if a virtual-communication (virtual COM port) USB device is plugging into the PC (the LP Alpha itself.)
From PC perspective, on one of its own USB port, it will see a USB HID 2341:8036 device attached to it.

LP Alpha's USB and Arduino Leonardo's USB ports are back-to-back connected. PC side is USB master and Arduino side is USB slave device.

If Arduino's IDE USB device driver is properly installed, the *.INF file will identify 2341:8036 as a CDC-ACM device, enumerate/load the device driver and thus seeing such "USB device (Arduino Leonardo)" as a device on its COM port (in win10, it's COM3; in Linux it's dev/ttyACM0 I think.)


On b)
On board Arduino Leonardo's behavior should be just the same as external Arduino board (if you set Arduino Power Control in BIOS ... )

(There really is an ATMega32u4 chip in LPA playing the Arduino Leonardo role.)

User avatar
Isotope
Posts: 2
Joined: Wed Feb 27, 2019 5:10 pm

Fri Mar 01, 2019 4:16 pm

Thank you for replying. I am still somewhat confused. If I need to select a com port then what is in that port? The Arduino IDE is preinstalled on the Alpha so why would I need external serial communication?

EDIT: Nevermind! Got it working! It's so easy I love this LP. Thanks!

User avatar
becafuel
Posts: 3
Joined: Mon Aug 05, 2019 2:07 pm

Tue Aug 06, 2019 12:47 pm

Hello all,

Can someone please clarify : does this mean that Visual Studio (for example) would not be able to program/use the Arduino chip ?

More precisely, I was thinking at this board to replace NETMF for embedded boards but I can't find any doc on using VS/C# (for example) to have SPI/I2C/PWM working. Is that even possible ?


_______
Christophe

User avatar
ccs_hello
Posts: 441
Joined: Sat Oct 13, 2018 9:16 pm

Tue Aug 06, 2019 3:25 pm

becafuel wrote:
Tue Aug 06, 2019 12:47 pm
Hello all,

Can someone please clarify : does this mean that Visual Studio (for example) would not be able to program/use the Arduino chip ?

More precisely, I was thinking at this board to replace NETMF for embedded boards but I can't find any doc on using VS/C# (for example) to have SPI/I2C/PWM working. Is that even possible ?


_______
Christophe
Let's going back to the basics:
LPA has two independent sides: X86 side (the main CPU) and the MCU ATmega32u4 side (typically runs Arduino code.)

In programming mode,
the main processor (X86/AMD64) can "program" the MCU side by using Arduino IDE, which is its own ecosystem. If you want to find a replacement of Arduino IDE, you are on your own. (Actually, you can completely abandon the Arduino ecosystem and go for your own chosen scheme, Just a lot of work involved.)

Now, in normal operating mode, Arduino side runs its own code and X86 side runs its own code. The Arduino is not part of the X86 CPU's extension.

There is a (at least one) special arrangement that X86 side can run Firmata "control" code, while Arduino side can run Firmata "slave" code.
Under Firmata framework, the Arduino indeeds behaves like as if it's X86 CPU's directly attached peripheral (such as SPI, I2C, etc.), if the PC side is using the Firmata library.
< --- You can write your own code (say using C++ ) to mimic the similar functionality instead of using Firmata. But again, you are on your own.

User avatar
becafuel
Posts: 3
Joined: Mon Aug 05, 2019 2:07 pm

Wed Aug 07, 2019 7:10 am

Thank you for the clarification.
Then this product is not for me at the moment.

Last question : do you plan any support for Windows 10 IOT Core ?


Best regards,
_________
Christophe

User avatar
ccs_hello
Posts: 441
Joined: Sat Oct 13, 2018 9:16 pm

Wed Aug 07, 2019 12:09 pm

becafuel wrote:
Wed Aug 07, 2019 7:10 am
Thank you for the clarification.
Then this product is not for me at the moment.

snip snip
If you are into the .NET Micro Framework, (mainly for inexpensive but more resourceful MCU), LPA does not fit that category IMHO.
Its x86 side to overly powerful but not I/O rich, while its (low end) Arduino side is not resourceful for NETMF.

Also, Windows IoT is really meant for (higher-end) MCU, which is an overkill for LPA's x86, but not for its Arduino (Arduino Leonardo.)

User avatar
becafuel
Posts: 3
Joined: Mon Aug 05, 2019 2:07 pm

Sun Aug 11, 2019 9:33 am

Then I confirm that this product is not for me.

Thank you anyway for your time !

Post Reply