Linux

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

Linux

Post by YahooArchive »

We have been working with the ARMmite under Linux for some months now.
In the past, we have had to use a Windows station for firmware
downloads, and TCL to interact with the ARMmite over its USB port on
the Linux side. This last issue has to do primarily with the default
handling of DTR (and RTS) by the ARMmite, which unlike many other
serial devices, interprets DTR high by a PC as a debug stop request,
rather than a signal that it is OK to transit data.

Recently, after reviewing the post at
http://www.coridium.us/ARMhelp/scr/HwUSB2.html entitled "USB use
with MatLab, Hyperterm, TeraTerm," we tried using the ARMite under
Linux in a modified mode, where DTR high does not stop operation.
While this procedure does require a Windows system to perform, once
that is done, the ARMmite becomes much friendlier under Linux.
Specially, we were able to use BASH level tools to view data streaming
from the device, as well as minicom, as well as pyserial with python.
I suspect from how easy this worked with these tests (19.2,n,8,1)
with this patch that other Linux tools would work perfectly well with
the ARMmite now.

These tests were performed using a Debian i386 Etch build, with a
stock Debian 2.6.18-3 kernel. They were performed on 3 different
Pentium class systems, using Intel motherboard chip sets. While it
appears to still be necessary to use a Windows system for the firmware
uploads, after that, the ARMmite works well under Linux flowing data
out its USB serial port with standard Linux serial tools.



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

Re: Linux

Post by YahooArchive »

I was able to get my ARMmite to talk to my Linux box using Python and
Chris Liechti's pyserial module.

0. Write a simple BASIC program using your Windows box. I used a demo
program by Michael Grollman.

DIR(15) = 1 ' Enable pin 15 as an output.
WHILE X < 30
OUT(15) = X AND 1 ' Drive pin 15 high when X is odd, low when X is even.
X = X + 1
WAIT(500)
PRINT "test", X
LOOP

1. Plug in the ARMmite USB cable to your Linux box. You should see a
/dev/ttyUSBn device appear in the /dev directory. My system shows up
as /dev/ttyUSB0. If you are using Ubuntu Feisty like I am, you will
need to first uninstall a problematic braille serial device driver.

sudo apt-get remove brltty brltty-x11

2. You can test your installation using gkterm and the following settings.

port: ttyUSB0
baud: 19200
parity: N
bits: 8
stop: 1
handshake: xon-xoff

Be sure to toggle DTR and RTS. There does not appear to be a way to
determine the state of DTR and RTS, so it's easy to get out of sync.
Toggle the ARMmite reset button to restart the BASIC program. You
should be able to see the loop print output on the terminal emulator.
Close gkterm when you are done.

3. Install python if necessary. Install the pyserial module found at
http://pyserial.sourceforge.net/

4. The following Python script will open a serial port with the
ARMmite, toggle reset, close the port, and exit.

#!/usr/bin/env python
# This is a simple script that opens a serial connection to
# a Coridium ARMmite controller and toggles reset, causing
# the resident program to restart.

# Import the pyserial module.
#
import serial

# Open the port. Specify baudrate and handshake.
#
ser = serial.Serial('/dev/ttyUSB0',baudrate=19200,xonxoff=1)

# Enable the ARMmite. We could have done this in the constructor
# above, but we want to show the following important steps.
# Deassert Request to Send, which enables Data Carrier Detect
# which alerts the ARMmite of a serial connection.
# Deassert Data Terminal Ready which deasserts reset.
#
ser.setRTS(0)
ser.setDTR(0)

# Toggle the ARMmite reset. The LED should flash after this.
#
ser.setDTR(1)
ser.setDTR(0)

# Close the serial port.
#
ser.close()

I have a working document at
http://ironwoodlabs.com/mediawiki/index ... ngle_Board_\
Computer

-Ron

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

Re: Linux

Post by YahooArchive »

Hi,

We can now run the arm7 c compiler on linux to produce hex files.

1. What tool do we use to upload the hex files to the ARMmite?
2. We have a c source file called upload.c which we acquired from this
ARMexpress group. Is this the "loader"?
3. Does the same loader algorithm work for both Basic and C?
4. Does the c hex code loader wipe out the on-board Basic?
5. Is there a way to recover the on-board Basic?

-Ron

coolgee6
Posts: 1
Joined: Fri Dec 05, 2014 10:16 am

Re: Linux

Post by coolgee6 »

As info, in the Options|Advanced Options dialogue, on the Hardware
tab, I had to place a check by "Use DTR and RTS to control RST and
p0.14" and on the communications tab, I put 19200 as the Baud Rate.
ahsan

Post Reply