Searching \ for '[OT] Hardware access under Linux' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/index.htm?key=hardware+access
Search entire site for: 'Hardware access under Linux'.

Exact match. Not showing close matches.
PICList Thread
'[OT] Hardware access under Linux'
1999\01\19@170057 by Scott Newell

flavicon
face
Every once in a while, people discuss building PIC programmers or other
hardware for use under Linux.  Now that I've got a Linux machine built up,
I'm interested in using the PC's serial and parallel ports to interface to
various devices, including some PIC projects.

Does anyone have any good links or pointers to this kind of low-level
device access?  (I'm comfortable with C++, and I really don't want to deal
with the backwards AT&T-style x86 assembler syntax.)


Thanks in advance,
newell

1999\01\19@175008 by James Cameron

flavicon
face
Scott Newell wrote:
> Does anyone have any good links or pointers to this kind of low-level
> device access?

Yes, sure.  Fetch picprg2.2 from
http://www.tatoosh.com/nexus/picpgmr.shtml for a simple example of
low-level access to the printer port under Linux.  See the file lowlvl.c
within the package.  No assembly code required.

I have adapted this code for my own use to program 12C509 chips.

--
James Cameron                                      (spam_OUTcameronTakeThisOuTspamstl.dec.com)

OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.

1999\01\20@070751 by Bob Drzyzgula

flavicon
face
On Tue, Jan 19, 1999 at 03:59:11PM -0600, Scott Newell wrote:
> Every once in a while, people discuss building PIC programmers or other
> hardware for use under Linux.  Now that I've got a Linux machine built up,
> I'm interested in using the PC's serial and parallel ports to interface to
> various devices, including some PIC projects.
>
> Does anyone have any good links or pointers to this kind of low-level
> device access?  (I'm comfortable with C++, and I really don't want to deal
> with the backwards AT&T-style x86 assembler syntax.)

Two good books that cover this topic are:

Linux Device Drivers by Alessandro Rubini (O'Reilly)
www.amazon.com/exec/obidos/ASIN/1565922921/qid%3D916832697/002-1508759-93
54633

and

Linux Kernel Internals 2/E, Edited by Michael Beck (Addison-Wesley)
www.amazon.com/exec/obidos/ASIN/0201331438/ref=sim_books/002-1508759-9354
633

In addition, the book

Programming the Parallel Port; Interfacing the PC for Data
Acquisition and Process Control by Dhananjay V. Gadre (R&D Books)
www.amazon.com/exec/obidos/ASIN/0879305134/qid=916833059/sr=1-2/002-15087
59-9354633

while mostly DOS-oriented, does have one chapter on
writing a Linux device driver for a parallel-port DAQ
application (beware, though, I found that this book
uses really funky jargon and diagrammatic conventions,
and is rife with typos. Still, if you can get past that,
there's a lot to learn from it).

Most of what goes on at that level is typically
done in ANSI C, rather than C++.

--Bob

--
============================================================
Bob Drzyzgula                             It's not a problem
.....bobKILLspamspam@spam@drzyzgula.org                until something bad happens
============================================================

1999\01\20@104910 by Byron A Jeff

face picon face
{Quote hidden}

8759-9354633
{Quote hidden}

Bob,

I'm thinking that the device driver level is a bit too far under the surface
for what Scott wants to do. Both parallel and serial interfaces are accessible
from the user level, the parallel port via the port interface, the serial
ports via the already excellent serial driver.

The Linux IO-Port programming Mini-Howto has more than enough information to
get started. It can be found at:

http://metalab.unc.edu/LDP/HOWTO/mini/IO-Port-Programming.html

As another poster pointed out the low level interface code for the Linux
based picprg by Brian Lane of Nexus computing:

http://www.tatoosh.com/nexus/picpgmr.shtml

is quite instructive.

For the most part a Linux driver is required under one of three conditions:

1) Interrupts are involved.
2) Timing is critical.
3) Access must be managed to multiple simultaneous users/applications

For simple stuff to the parallel port just use the user level I/O interface
and make the application setuid root (because I/O require root access).

BTW it may bear repeating (I haven't seen a Linux based environment discussion
lately) that a Linux based PIC environment is doable. Last semester I had one
of my students build a parallel port based 16[CF]84 programmer that uses
Nexus Computers picprog to program, Timo Rossi's picasm located:

http://www.iki.fi/trossi/pic/

for an assembler, and I experimented with Scott Dattalo's gpsim simulator at:

http://interstice.com/~sdattalo/gnupic/gpsim.html

Which works really well but I think need in addition to the complicated node
and waveform based pin simlation a really simple interface where you can just
set a pin high or low for input.

I banged out two quick light control projects over the holidays with this
setup and was extremely happy to finally retire my PICSTART/DOSEMU based
system that I was using earlier.

Next on my project list is adding a second 16C84 based programmer with a
serial interface which will program the rest of the PIC family.

I'm looking forward to hearing more about PIC and Linux integration here on
the list.

BAJ

1999\01\20@112427 by erik

flavicon
face
I ran across this the other day.
I haven't been able to download it though.

http://reality.sgi.com/jamesb/gpasm/


Erik


Byron A Jeff wrote:
{Quote hidden}

508759-9354633
{Quote hidden}

1999\01\20@120137 by Scott Dattalo

face
flavicon
face
with respect to parallel port Linux drivers,

On Wed, 20 Jan 1999, Byron A Jeff wrote:

> For simple stuff to the parallel port just use the user level I/O interface
> and make the application setuid root (because I/O require root access).

True. In fact, The person working on hacking the PicStart+ protocol has
been successful capturing the data flowing on the serial line between a PC
(running windows) and the programmer. Then he could cat that data from
Linux directly to the Picstart+ and get the programmer to respond! All of
this without writing any special drivers or even needing an oscilloscope.

> BTW it may bear repeating (I haven't seen a Linux based environment discussion
> lately) that a Linux based PIC environment is doable. Last semester I had one

That's because most of the Linux based pic development discussion has
moved to the gnupic mailing list. Here lately though, the only traffic has
pretty much been gpsim release announcements.


> of my students build a parallel port based 16[CF]84 programmer that uses
> Nexus Computers picprog to program, Timo Rossi's picasm located:

> http://www.iki.fi/trossi/pic/

That is a very nice assembler. However, I would recommend gpasm instead
since it accepts mpasm formatted source files without modification:

http://reality.sgi.com/jamesb/gpasm/

> for an assembler, and I experimented with Scott Dattalo's gpsim simulator at:
>
> http://interstice.com/~sdattalo/gnupic/gpsim.html
>
> Which works really well but I think need in addition to the complicated node
> and waveform based pin simlation a really simple interface where you can just
> set a pin high or low for input.

The stimulation interface is way too complicated.... I will be addressing
this issue shortly. In the mean time however, I've begun hacking gpasm to
provide symbolic information that may be used by gpsim. In the next
release I expect to add commands that will allow one to view source and
list files and set breakpoints symbolically. Incidentally, I've also begun
devoping a gui based register viewer. I probably will not have that
available in the next gpsim release though.

> I banged out two quick light control projects over the holidays with this
> setup and was extremely happy to finally retire my PICSTART/DOSEMU based
> system that I was using earlier.
>
> Next on my project list is adding a second 16C84 based programmer with a
> serial interface which will program the rest of the PIC family.

Great! I'll be looking forward to that!

> I'm looking forward to hearing more about PIC and Linux integration here on
> the list.

Me too. However, many of us prefer to have the detailed discussions on the
GNUPIC mailing list. Go to the gnupic webpage on info how to subscribe.

http://reality.sgi.com/jamesb/gnupic/

(The traffic is 2.5 orders of magnitude lower)

Scott

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...