Well I need to know if they work so I can control them directly via the
software on the sbc.. i.e if I set DIO #3 to output and value 1 then i should
read 3.3v from pin #3, and if i set it to output and value 0 then I should read
0v.. this is basic functionality to build anything external to the sbc so it
has to work, they advertise this as a feature and provide scripts so it should
work, I need someone to confirm that it does, the led and temp work I know
this, but what about the digital input/output pins?
--- In Clark Dunson <> wrote:
>
> Claudio, gotcha;
>
> Those are miniroot commands:
>
> Technologic Systems TS-7xxx Linux miniroot commands:
> ====================================================
>
> 'save' - save current miniroot initrd configuration to flash
> 'exit' - start full Linux boot or exits telnet session
> 'dio_dir_get DIO_NUM' - Get Data Direction Register
> 'dio_dir_set DIO_NUM DIR' - Set Data Direction Register
> 'dio_data_get DIO_NUM' - Get Data Register
> 'dio_dat_set DIO_NUM DATA - Set Data Register
> 'usb_init' - Initialize USB
> 'usb_off' - Disable USB Clock
> 'usb_num_ports' - Get number of USB ports
> 'usb_port_devexists' - Check if a USB device is present
> 'eth_off' - Disable Ethernet(power down phy)
> 'eth_on' - Enable Ethernet
> 'led0 STATE' - Turn on/off green LED
> 'led1_STATE' - Turn on/off red LED
> 'temp_read' - Print temp (requires optional temp sensor)
>
>
> Sorry, I have verified only 'led0', 'led1', and temp_read.
> Were you planning on doing any development or just using the machine out
> of the box?
>
>
> On Feb 11, 2011, at 9:04 AM, wrote:
>
> > I'm talking about running the following commands that come with the
> > ts-7260:
> >
> > dio_dir_get <n>: get the current direction (0=input,1=output) of
> > DIO #n (n in 0..15)
> > dio_dir_set <n> <dir>: set the direction of DIO #n to the specified
> > direction
> > (0=input,1=output)
> > dio_data_get <n>: get the current value (0=Low,1=High) of DIO #n
> > dio_data_set <n> <val>: set the current value
> >
> > have any of you used these scripts/commands sucessfully out of the
> > box? I need to know if they work before purcashing the ts-7260,
> > because i purchased a ts-4200/ts-8100 and the scripts on the board
> > do not work.
> >
> > Claudio
> >
> > --- In "Clark" <cdunson@> wrote:
> > >
> > > Answer: This code does work on my system.
> > >
> > > --- In "Clark" <cdunson@> wrote:
> > > >
> > > > Let's see if we can't focus this discussion a little better. Is
> > this the same deal I face attempting to access GPIO? Joel said I
> > need to use a read-modify-write instruction, yet the TS sample code
> > 'button.c' shows the naive approach of using simple assignment in
> > C. Thus the question to me is does this sample code work? Why not?
> > > >
> > > > / filename button.c
> > > > // connect a button to DIO pin 1 and ground
> > > > // blinks green and red led on the ts-7200 when button is pressed
> > > > //
> > > > // compile arm-linux-gcc -o button button.c
> > > > //
> > > >
> > > > #include<unistd.h>
> > > > #include<sys/types.h>
> > > > #include<sys/mman.h>
> > > > #include<stdio.h>
> > > > #include<fcntl.h>
> > > > #include<string.h>
> > > >
> > > > int main(int argc, char **argv)
> > > > {
> > > > volatile unsigned int *PEDR, *PEDDR, *PBDR, *PBDDR, *GPIOBDB;
> > > > int i;
> > > > unsigned char state;
> > > > unsigned char *start;
> > > > int fd = open("/dev/mem", O_RDWR|O_SYNC);
> > > >
> > > > start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE,
> > MAP_SHARED, fd, 0x80840000);
> > > > PBDR = (unsigned int *)(start + 0x04); // port b
> > > > PBDDR = (unsigned int *)(start + 0x14); // port b direction
> > register
> > > > PEDR = (unsigned int *)(start + 0x20); // port e data
> > > > PEDDR = (unsigned int *)(start + 0x24); // port e direction
> > register
> > > > GPIOBDB = (unsigned int *)(start + 0xC4); // debounce on port b
> > > >
> > > > *PBDDR = 0xf0; // upper nibble output, lower nibble input
> > > > *PEDDR = 0xff; // all output (just 2 bits)
> > > > *GPIOBDB = 0x01; // enable debounce on bit 0
> > > >
> > > > state = *PBDR; // read initial state
> > > > while (state & 0x01) { // wait until button goes low
> > > > state = *PBDR; // remember bit 0 is pulled up with 4.7k ohm
> > > > }
> > > >
> > > >
> > > > // blink 5 times, sleep 1 second so it's visible
> > > > for (i = 0; i < 5; i++) {
> > > > *PEDR = 0xff;
> > > > sleep(1);
> > > > *PEDR = 0x00;
> > > > sleep(1);
> > > > }
> > > > close(fd);
> > > > return 0;
> > > > }
> > > >
> > > >
> > > > --- In dalibor@ wrote:
> > > > >
> > > > > > can someone confirm the DIO pins work on the ts-7260 using
> > the provided
> > > > > > scripts ?
> > > > > >
> > > > > >
> > > > >
> > > > > Hello,
> > > > > probably the same problem,
> > > > >
> > > > > I am not able to control DIO pins from user space. Tried C
> > code via
> > > > > registers, peekpoke, GPIO kernel modules, but nothing worked.
> > The pins are
> > > > > still high (log 1). LED connected to the pin is still lighting.
> > > > >
> > > > > The only thing I managed is to read the pins, when I connect
> > it to ground,
> > > > > I can read log 0, log 1 when disconnected.
> > > > >
> > > > > Thanks in advance for any tips..
> > > > >
> > > > > Dalibor
> > > > >
> > > >
> > >
> >
> >
>
------------------------------------
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/
|