Hi everyone. I've been trying to do a basic test on the DAC on the
9700 board and I can't seem to get any response whatsoever from the
DAC channels.
I've been using suggestions from other users who have posted problems
with the 9700 board before but none seem to work. Here is the source code:
The idea of the test is to output the value 2000 to the DAC (thus
generating a voltage of around 2.5). I've output this value to all
channels and none of them produce anything when tested.
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
extern int errno;
#define BASE 0xEE000000
#define LDAC 0x164
#define MDAC 0x165
typedef unsigned char byte;
main(){
byte *base;
volatile byte *ldac;
volatile byte *hdac;
unsigned short int val;
unsigned int *regs;
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);
printf("%d\n", base);
ldac = base + LDAC;
hdac = base + MDAC;
//unsigned char *dac6 = base + 0x16E;
*ldac = 0xd0;
*hdac = 0xc7; //channel 4
*ldac = 0xd0;
*hdac = 0x10; //channel 1
*ldac = 0xd0;
*hdac = 0x50; //channel 2
*ldac = 0xd0;
*hdac = 0x90; //channel 3
//}
return 0;
}
Any suggestions would be most welcome :)
Thanks
Chris
------------------------------------
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/
|