gnupic: Thread: Help with pic over usb


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Help with pic over usb
From: Anne Vanhoest ####@####.####
Date: 14 Feb 2011 12:46:34 -0000
Message-Id: <Pine.GSO.4.58.1102141240120.22880@socrates-a.ucl.ac.uk>

Hello,

I am a linux user (running Fedora 13 at work and some Ubuntu or related at
home) and I would like to work with a PIC32 on a board
connected to my computer via USB.  The way I have seen it done by someone
with a windows computer is that he ran a terminal emulator [BV-Com.exe]
and the connection to the pic was done, then he could
load and run his programs.  The programs are written in "ByVac" Basic.
The board comes with a SD drive so at the moment I
save the programs on the card, then power up (using the USB cable) to
test.  So I don't convert the programs, just save them on the card and
they run.

The board is provided by ByVac, and they said there should be
no problem with linux, that any terminal emulator would do.  But how do I
get "any terminal emulator" to connect to the virtual com port?

To be clear, I do not want to test my programs on the computer, I would
just like to load them from the pc.

Any suggestions?

I apologise if this question is pretty basic, maybe even stupid, I have
been using linux for more than 10 years so it's rather the PIC that's the
novelty to me.

Anyway, I thank you in advance for any help you may be able to provide.

Best regards

anne

###########################################

anne Vanhoest

Implanted Devices Group

Medical Physics and Bioengineering Department
Malet Place Engineering Building
UCL

Gower Street
WC1E 6BT London

phone: 020 7679 0296 (internal: 30296)
fax: 020 7679 0255
Subject: Re: Help with pic over usb
From: Peter Stuge ####@####.####
Date: 14 Feb 2011 13:44:27 -0000
Message-Id: <20110214134423.3213.qmail@stuge.se>

Hi Anne,

Anne Vanhoest wrote:
> terminal emulator [BV-Com.exe] and the connection to the pic was
> done, then he could load and run his programs. The programs are
> written in "ByVac" Basic.

How exactly were programs loaded using BV-Com?

From your description it seems to me that the board is more or less
permanently running a ByVac BASIC interpreter on the PIC, and that
the actual program code flashed into the PIC never really changes.


> The board is provided by ByVac, and they said there should be
> no problem with linux, that any terminal emulator would do.  But
> how do I get "any terminal emulator" to connect to the virtual com
> port?

That depends on the particular terminal emulator.

First, in order for there to be a virtual serial port device that is
emulated by using USB, the Linux kernel must recognize the USB part
of the board, and must have a driver for it. There are many common
ways to make this work fine. You can do two fairly simple tests:

Start the Linux system with the PIC board disconnected. Open any
command line interface. Connect the USB cable to the PIC board.
Then run:

dmesg | tail -n 40

And/or:

ls -l /dev/ttyUSB*

The former shows messages from the kernel, and should mention that a
new USB device was connected, and if it was recognized then also
which /dev/ttyUSB device it has been assigned.

Next step is to choose a program to communicate with the board. The
so-called terminal emulator. There are likely some requirements on
this program, but since then vendor could not clearly specify them
you're pretty much left to discover that on your own.

I have used minicom a lot, but lately have switched to more
lightweight alternatives such as picocom and/or xc. These are all
CLI based programs. Maybe there is also a GUI based one in Fedora and
Ubuntu.

Simply start the program with the serial port device as parameter.

minicom /dev/ttyUSB0


Best of luck

//Peter
Subject: Re: Help with pic over usb
From: John Maxwell ####@####.####
Date: 18 Feb 2011 23:58:00 -0000
Message-Id: <1298073478.6833.0@deepthought.jmaxhome.com>

On 02/14/11 07:46:28, Anne Vanhoest wrote:
> But how
> do I
> get "any terminal emulator" to connect to the virtual com port?
> 

Linux includes drivers for most (I'm tempted to say "all", because I've 
never found an exception, but that'd be begging for trouble) devices 
which conform to the USB CDC (the USB sub-spec for com port-like 
devices)

Plugging in a such a device usually results in a new device file 
showing up on the machine. Typical filenames are /dev/ttyUSB0 or
/dev/ttyUSB1 or the like.

To find out for sure whether your Linux box is noticing the PIC32 board 
and setting things up properly, do a tail -f on /var/log/messages, and 
then plug the device in. You should see a flurry of messages indicating 
that Linux has seen the new device, and (hopefully) what device file 
it's accessible as.

Given that all of the above works, just tell minicom to use /dev/
ttyUSB0 (substitute appropriate terminal program and device file, of 
course) as its communications port.

-John

--
John Maxwell  KB3VLL  ####@####.####

Exit ramps - suburban America's skid pads.
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.