Changing parameters from a PC

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Changing parameters from a PC

Post by YahooArchive »

I have an Armmite that I have programmed in C. It reads an A-D and compares the
result to 6 values stored in memory as constants. It then peforms some operation
based on that comparison.

I want to be able to change the constants from a Windows environment through the
USB port.

My thoughts are that I need to declare the constants at a fixed location in
flash memory. Next I need a subroutine to handle the USB commands and return
some information. I believe that I can accomplish this in my C program.

My question is: What type of program do I need to supply a GUI, so the user can
observe and change the 6 values without recompiling & reprogramming the Armmite?



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

The USB connection between the ARMmite and the PC looks to the PC like a serial
port. On the ARM side, it can be read and written through UART0.

So all you need on the PC side is a program that can send data out a serial port
as controlled from a GUI.

Your choices there are pretty wide VB.net (Cor_UDP.zip in files section), Tcl
(which is what I'm comfortable in generating GUIs on the PC), Liberty BASIC (I
don't know much about this), various C's (I use gcc for generating command line
programs, but not GUI, but .net would), Java, Python, Perl, ...

On the ARMmite side, it just has to respond to bytes sent over the serial port.
You get to define the protocol, keep it simple, like A123, sets A parameter to
123.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

So, the advice is KISS(Keep It Simple Stupid) on the ARM side. It's the PC side
that I'm not familiar with. I've done some web based programming in PHP and
HTML, but never a GUI. I'll look into Tcl and VB.net.

Is VB.net the same as Visual Basic?

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

> So, the advice is KISS(Keep It Simple Stupid) on the ARM side.

I'd certainly agree with that!

>
> Is VB.net the same as Visual Basic?
>

VB.net is Visual Basic for .NET There are language differences form the older
Win32 versions of Visual Basic but if you've used that you shouldn't find it to
hard to adapt.

The terminal emulator that is built into Astrobe (our Cortex-M3 / LPC2000
Development Environment) uses the .NET Serial IO routines to communicate with
Coridium's SuperPro, ProPlus, ARMMite Pro and ARMMite. Less than 100 lines of
code were required.

We used C# but there is sample VB code available:

http://msdn.microsoft.com/en-us/library ... lport.aspx

Regards,
Chris Burrows
CFB Software
http://www.astrobe.com

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

My first post to this group so I'm not sure if simply replying to your msg will
have the desired effect.
There is a open source package called processing

http://processing.org that is
for building GUI's I have used it with Arduino but It can be used for any
number of things. There is an add on for it controlP5.... that makes it very
easy to create slider controls and many other type visual tools for
communicating with your project

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

I'd welcome an example using processing to talk to an ARM.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

There is always the option of using a scripting language to implement a UI to
communicate with the Coridium SBCs.

I prefer autohotkey (don't let the name fool ya - it is darn powerful), which I
use regularly. There are others, of course.

Bruce mentioned TCL and others. The syntax causes me fits with most of the
others.

AHK is likely the syntactically closest with ARMbasic (barring VB, of course).
There are great forums and a solid IRC channel (20+ regulars) @ Freenode's #ahk.

I use ahk on a regular basis (as a platform for a custom ARMbasic IDE (not ready
for prime time, yet)). I have some libs I can provide, if there is interest.
If so, when I get back into town I'll pull some data together and post to the
group's file section.

-t

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

Something like TclTerm in MakeitC should work. I would need a data box, and
variable selection box, and Write & Read buttons.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Changing parameters from a PC

Post by YahooArchive »

Yep, Bruce has helped to nudge me along to add buttons therein for reload,
enter (to continue after a debugin), and what not.

Good luck!

-t

Post Reply