--- In "Ashley" <> wrote:
>
> Thanks, It didn't even come to me that they were 5v and 3.3. Does
> anyone have some source code for writing the DIO line high for the
> transistor?
>
This should point you in the right direction.
#define DIO0 0x01
#define DIO1 0x02
#define DIO2 0x04
#define DIO3 0x08
#define DIO4 0x10
#define DIO5 0x20
volatile unsigned char *pbdata, *pbddr;
int mem = open("/dev/mem", O_RDWR);
unsigned char * start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE,
MAP_SHARED, mem, 0x80840000);
pbdata = (unsigned int*)(start + 0x04);
pbddr = (unsigned int *)(start + 0x14);
// All inputs
*pbddr = DIO4 | DIO5; // DIO 4/5 outputs.
*pbdata = 0xff; // set to all 1's
By setting a bit in the DDR to 1, you set it to be an output. (This is
opposite to my past
experience, where 0 = Output and 1 = Inpput. More memorable that way around).
Martin
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/
|