ts-7000
[Top] [All Lists]

[ts-7000] Hi Ts7250 + ts 9700 DAC Problem

To:
Subject: [ts-7000] Hi Ts7250 + ts 9700 DAC Problem
From: "ugumugu" <>
Date: Fri, 18 Jan 2008 13:42:31 -0000
Hi everybody,

I use below source to use the ts9700,

While everything on the ADC part is perfect, there is no output on the
DAC side.

Could you please give me some advice on it.


Best Regards.
F. Ugurtan Erdem
*******************


#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>

#define BASE 0x11C00000
#define ADBASE 0x160
#define ADCOMMAND ADBASE
#define ADDATA ADBASE + 2
#define DAC ADBASE + 4 
#define ADREADYBIT 7
#define NUM_CHANNELS 5

typedef unsigned char byte;

main(){
  byte *base;
  volatile byte *adcommand;
  volatile byte *lsb;
  volatile byte *msb;
  volatile byte *ldac;
  volatile byte *hdac;
  unsigned short int val;

  int fd;
  float volts;
  int i,j;
  fd = open ("/dev/mem" , O_RDWR|O_SYNC);
  base = (byte *)mmap(0, getpagesize(), PROT_READ | PROT_WRITE,
MAP_SHARED, fd, BASE);
  adcommand = base + ADCOMMAND;
  lsb = base + ADDATA;
  msb = base + ADDATA + 1;
  ldac = base + DAC;
  hdac = base + DAC + 1;
  
while (1) {
  for (j=0; j<NUM_CHANNELS; j++)
  {
    *adcommand = j;
    while(!(*adcommand & (1 << ADREADYBIT)));
    volts = (256 * *msb + *lsb) * 2.5 / 4096;

  val = 2000;
  val |= (0x0 << 14);
  *ldac = val;
  *hdac = 0xFF;
  printf ("%1.3f ",volts);
  }
  printf("\n");
usleep(100000);
}
}


***********************************



 
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/
 

<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