ts-7000
[Top] [All Lists]

Re: [ts-7000] TS-7300, DIO & Keypa

To:
Subject: Re: [ts-7000] TS-7300, DIO & Keypa
From: "Don W. Carr" <>
Date: Sun, 12 Nov 2006 19:12:08 -0600
I don't thing the attachments work, so I will paste it in directly. This program has two modes, as either inputs or outputs. In the output mode, it flashes the outputs on and off every second. Don.


#include<stdio.h >
#include<string.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<sys/time.h>
#include<fcntl.h>

volatile unsigned char *ddir, *data;
struct timeval repeat_time;

int main(int argc, char *argv[])
{
  unsigned char *start;
  int fd = open("/dev/mem", O_RDWR|O_SYNC);
  start = (unsigned char *)
     mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x80840000);
  data = "" char *)(start + 0x4);
  ddir = (unsigned char *)(start + 0x14);

  if (argc > 1)
  {
    printf("Outputs\n");
    *ddir = 0xFF;

    while (true)
    {
      *data = ""
      usleep(500000);
      *data = "">      usleep(500000);
    }
  }
  else
  {
    printf("Inputs\n");
    *ddir = 0x00;

    while (true)
    {
      unsigned int val, mask;
      val = *data;
      printf("%02x  ", val);
      for (int i=0; i < 8; i++)
      {
    mask = 0x1 << i;
    if ((val & mask) != 0)
    {
          printf("1");
    }
    else
    {
      printf("0");
    }

      }
      printf("\n");
      val = val << 1;
      usleep(500000);
    }
  }
}



On 11/12/06, phygman <> wrote:

Hello All,

I've just spent the entire day trying to get the keypad to work on the
7300, and it still doesn't work.

The output lines on the DIO will not go LOW, they stay continuously
stay high. I can configure the DIO as inputs, and see the line toggle
when I pull it low. So I'm sure I've gotten it working the way you
expect in software.

I'm starting to wonder if I fried something on my board. Does anyone
have any working code for the keypad on the 7300. If so, could you
email it to me. Or if you can think of something else to try, reply
to the post.

Thanks
Jim Newton




--
Dr. Don W. Carr
J. G. Montenegro 2258
Guadalajara, Mexico
+52-333-630-0704
+52-333-836-4500 ext 2930 __._,_.___


SPONSORED LINKS
Single board computer Hardware Computer running slow
Linux os Single board

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU