I think the previous two answers are a bit harsh, here is how it actually works:
The PC104 connector is either general purpose IO or it is ISA. It defaults to
GPIO, which means the peripheral boards you can attach on them will not work.
You need to write some values to a memory location to switch the PC104
connector into ISA mode first.
To write to memory locations as specified in the documentation you can use
peekpoke from the command line, it is just a little C program that TS has
written to make it easy to test and configure hardware without actually writing
any software. It allows you to read and write to memory locations.
If you are developing your own software you can use any language supported on
linux, it does not have to be C code at all. In fact, why not use python, perl,
or shell scripts for simple stuff?
To write to specific memory locations in linux you need to use a "trick",
normally a linux program (refered to as userspace application) cannot write to
memory locations directly. What you can do is write to /dev/mem and read from
/dev/mem. The peekpoke application is available in source code to see how this
is done in C. What I would do in python or shell scripts is simply call the
peekpoke commands and read the outputs to use your hardware.
A list of commands you can run manually is:
(first setup pc104 into ISA mode,
http://www.embeddedarm.com/about/resource.php?item=393#section6.4 )
peekpoke 32 0xE8000030 0x55555555
peekpoke 32 0xE8000034 0x55555555
peekpoke 32 0xE8000038 0x55555
peekpoke 32 0xE800003C 0x55555
(now look in your peripheral documentation and figure out what address to use
to read data/write data, for DIO64 you have 8bit IO and can use this to read
the inputs in one go (4 registers of 8 bits in order is 32 bits))
peekpoke 32 0xEE000108
(to activate all outputs)
peekpoke 32 0xEE000104 0xFFFFFFFF
Make sure to really read your hardware board and the TS7800 manual to figure
out how things actually work.
Have a wonderful time learning,
Wouter
________________________________________
From: On Behalf Of richar_in
Sent: Wednesday, December 01, 2010 12:21 AM
To:
Subject: [ts-7000] PC-104 Initialization and usage for a beginner
Hello
I am using a TS-7800 board and I am not familiar with programming using Linux.
I need to use the PC-104 bus to transfer data to another board .
1)I have the initialization values from the manual but where in the code should
I set them .And using which commands ?
2)" peekpoke BITS ADDRESS VALUE " needs to be set .I gathered from one of the
previous posts that to be set using the command line . Should I do it before I
compile the code ? And on the telnet connection or the serial connection ?
3) How can I check back the if the values have been written correctly ? I will
read that address to check but where can I see the value ?
Thanks
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|