Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: USB2.0 DVB receiver status update



On Mon, Feb 24, 2003 at 01:10:44PM +0100, Holger Waechtler wrote:

> > If you can send me the firmware and downloaded I can try it on my FX2
> > devel board. 
> 
> The source is in the LinuxDVB CVS: 
> http://linuxtv.org/cgi-bin/cvsweb.cgi/dvb-hw/dvbusb-fx2/, directory 
> dvb-hw/dvbusb-fx2/firmware/src/.

Ok, I'll try it.

> >>Next we'll work on the firmware to get the irq problem fixed and write a 
> >>i2c driver in the firmware so that we can talk to EEPROM and tuner.
> > 
> > I already have interrupt-based i2c communication working for (non-fx2)
> > ezusb. If that'd be of any help ...
> 
> Can you release this source as open source? If not we would have to 
> rewrite it anyway...

Of course. It's not very big, so I'm attaching it.

> btw: do you want your board assembled or do you want me to send you 
> PCB+parts (and a list of required patches;)?

Well, I'd prefer at least the FX2 soldered in ... but I can do any
patches myself. :)

-- 
Vojtech Pavlik
SuSE Labs
FEATURES=-DKEYBOARD -DMOUSE

#
# If you intend to build a firmware that will be programmed into the onboard
# I2C EEPROM set ROM_FW to -DROM_FIRMWARE. Leave ROM_FW blank if the firmware
# will be downloaded via USB.
#
ROM_FW=
#ROM_FW=-DROM_FIRMWARE

dana-io.ihx: Makefile dana-io.c dana-io.h ezusb_reg.h sdcc
	cd sdcc; \
	cp ../dana-io.c .; \
	cp ../dana-io.h .; \
	sdcc --stack-after-data -I.. ${ROM_FW} dana-io.c; \
	cp dana-io.ihx ..

sdcc:
	mkdir sdcc
clean:
	rm -f *~ *.o *_fw.h *.ihx
	rm -rf sdcc

install: dana-io.ihx
	cp dana-io.ihx /bot/modules
/*
 * I/O board control program for U.C.W./Sirael Dana robot.
 *
 * Version 1.0
 *
 * Copyright (c) 2002 Vojtech Pavlik
 * Copyright (c) 2001 Arnim Laeuger
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version. See also the file COPYING which came with this
 * application.
 */

#include <8051.h>
#include "ezusb_reg.h"
#include "dana-io.h"

static void init_variables()
{
	i2c_mode = 0;
	i2c_state = 0;
	i2c_index = 0;
	tx_head = 0;
	tx_tail = 0;
	tx_running = 0;
	in1_change = 0;
	beat = 0;
}

/*
 * get_descriptor()
 *
 * Sends the requested descriptor back to the host.
 * Currently supported descriptor types are:
 *   + device
 *   + configuration
 *   + string
 */

#pragma SAVE
#pragma NOOVERLAY
static void get_descriptor(void) using 1
{
   switch (sdat->wValueH) {
         /* type: device */
      case USB_DT_DEVICE:
         EP0CS   = 0x02;   /* clear HSNACK */
         SUDPTRH = (Byte)((unsigned int)dev_desc >> 8);
         SUDPTRL = (unsigned int)dev_desc & 0xff;
         break;

         /* type: configuration */
      case USB_DT_CONFIG:
         EP0CS   = 0x02;   /* clear HSNACK */
         SUDPTRH = (Byte)((unsigned int)conf_desc >> 8);
         SUDPTRL = (unsigned int)conf_desc & 0xff;
         break;

         /* type: string */
      case USB_DT_STRING:
         if (sdat->wValueL < NUM_STRING) {
            EP0CS     = 0x02;   /* clear HSNACK */
            SUDPTRH = (Byte)(string_index[sdat->wValueL] >> 8);
            SUDPTRL = string_index[sdat->wValueL] & 0xff;
         } else {
            EP0CS     = 0x01;   /* stall */
         }
         break;

      default:
         EP0CS     = 0x01;   /* stall */
         break;
   }
}
#pragma RESTORE

/*
 * usb_isr()
 *
 * USB interrupt service routine
 * Performs five major tasks:
 *   + parse the SETUP packets upon SUDAV interrupt and answer them
 *   + ack IN0 interrupts
 *   + ack IN1 interrupts
 *   + ack OUT0 interrupts
 *   + ack OUT1 interrupts
 */

static void usb_isr(void) interrupt 8 using 1 critical
{
   /* clear INT2 interrupt */
   EXIF &= 0xef;

   /* was this the SUDAV interrupt? */
   if (USBIRQ & 0x01) {

      /* clear SUDAV interrupt */
      USBIRQ = 0x01;

      switch (sdat->bRequest) {

            /* GetDescriptor */
         case 0x06:
            get_descriptor();
            break;

            /* GetConfiguration */
         case 0x08:
            if (sdat->bmRequestType == 0x80) {
               in0buf(0) = 0x01;
               IN0BC     = 0x01;
               EP0CS     = 0x02;   /* clear HSNACK */
            } else {
               EP0CS     = 0x01;   /* stall */
            }
            break;

            /* SetConfiguration */
         case 0x09:
            switch (sdat->bmRequestType) {
                  /* SetConfiguration */
               case 0x00:
                  EP0CS     = 0x02;   /* clear HSNACK */
                  break;

               default:
                  EP0CS     = 0x01;   /* stall */
                  break;
            }
            break;

         default:
            EP0CS     = 0x01;   /* stall */
            break;
      }

   }

   /* was this an IN0 interrupt? */
   if (IN07IRQ & 0x01) {
      /* clear IN0 interrupt */
      IN07IRQ = 0x01;
   }

   /* was this an IN1 interrupt? */
   if (IN07IRQ & 0x02) {
      /* clear IN1 interrupt */
      IN07IRQ = 0x02;
   }

   /* was this a OUT0 interrupt? */
   if (OUT07IRQ & 0x01) {
      /* clear OUT0 interrupt */
      OUT07IRQ = 0x01;
      /* arm endpoint again */
      OUT0BC = 0x00;
   }

   /* was this a OUT1 interrupt? */
   if (OUT07IRQ & 0x02) {

      /* clear OUT1 interrupt */
      OUT07IRQ = 0x02;

	if (out1buf(0) != 255) {

		/* Move servo to desired position */

		tx_buffer[tx_head] = 0xff;
		tx_head = (tx_head + 1) & (TX_BUFFER_SIZE - 1);
		tx_buffer[tx_head] = out1buf(0);
		tx_head = (tx_head + 1) & (TX_BUFFER_SIZE - 1);
		tx_buffer[tx_head] = out1buf(1);
		tx_head = (tx_head + 1) & (TX_BUFFER_SIZE - 1);

		if (tx_running == 0) {
			SBUF0 = tx_buffer[tx_tail];
	                tx_tail = (tx_tail + 1) & (TX_BUFFER_SIZE - 1);
			tx_running = 1;
		}
	} else {
		/* Switch power on/off */
		if (out1buf(1))
			OUTA |= 0x80;
		else
			OUTA &= 0x7f;
      }

      /* arm endpoint again */
      OUT1BC = 0;
   }

   /* was this the URES interrupt? */
   if (USBIRQ & 0x10) {
      /* clear request */
      USBIRQ = 0x10;
      /* initialize global variables */
      init_variables();
   }
}

static void serial_0_isr(void) interrupt 4 using 2 critical
{
	/* ack receiver interrupts (ignore) */
	RI_0 = 0;
	/* ack transmitter interrupts */
	TI_0 = 0;
	if (tx_head != tx_tail) {
		/* transmit queued data */
		SBUF0 = tx_buffer[tx_tail];
		tx_tail = (tx_tail + 1) & (TX_BUFFER_SIZE - 1);
		return;
	} 
	tx_running = 0;
}

/*
 * This routine is called on I2C transfer completion.
 */

static void i2c_isr() interrupt 9 using 3 critical
{
	/* Clear the i2c interrupt */

        I2CS;
	EXIF &= 0x10;

	switch (i2c_mode) {
	
		case I2C_PCF8591:

			switch (i2c_state++) {

				case 0:
					if ((I2CS ^ I2C_ACK) & (I2C_BERR | I2C_ACK)) goto fail;
					i2c_buffer[i2c_index + 0] = I2DAT;
					return;
				case 1:
					if (I2CS & I2C_BERR) goto fail;
					i2c_buffer[i2c_index + 0] = I2DAT;
					return;
				case 2:
					if (I2CS & I2C_BERR) goto fail;
					i2c_buffer[i2c_index + 0] = I2DAT;
					return;
				case 3:
					if (I2CS & I2C_BERR) goto fail;
					I2CS = I2C_LAST;
					i2c_buffer[i2c_index + 1] = I2DAT;
					return;
				case 4:
					if (I2CS & I2C_BERR) goto fail;
					I2CS = I2C_STOP;
					i2c_buffer[i2c_index + 2] = I2DAT;
					return;
			}

		case I2C_MAX127R:
		case I2C_MAX127W:
		case I2C_MAX1236:
			return;
	}
	
fail:
	I2CS = I2C_STOP;
}

#pragma SAVE
#pragma NOOVERLAY
static void i2c_start_read(Byte mode, Byte device) using 3
{
	i2c_mode = mode;
	i2c_state = 0;

	while (I2CS & 0x40);
	I2CS = I2C_START;

	switch (mode) {
		case I2C_PCF8591:
			i2c_index = device * 3;
			I2DAT = I2C_PCF8591_ADDR | (device << 1) | I2C_READ;	
			return;
		case I2C_MAX127R:
		case I2C_MAX127W:
		case I2C_MAX1236:
			return;
	}
}
#pragma RESTORE

/*
 * This routine is called every 4 ms.
 */

#define ABS(x)	((x)>0?(x):-(x))

static void timer2_isr() interrupt 5 using 3 critical
{
	Byte i;
	int x, y;

	TF2 = 0;

	beat++;

	if (!(beat & 0x3f))
		OUTC ^= 0x20;

	/* Read bumpers & switches */
	/* TODO: use interrupt */
	if (in1buf(0) != PINSB) {
		in1buf(0) = PINSB;
		in1_change = 1;
	}

	/* Read motor data */
	/* TODO: Process these, use interrupt! */
	if (in1buf(1) != PINSA) {
		in1buf(1) = PINSA;
		in1_change = 1;
	}

	for (i = 0; i < I2C_BUFFER_SIZE; i++) {
		x = i2c_buffer[i];
		y = in1buf(i + 8);
		if (x != y) {
			in1buf(i + 8) = x;
			in1_change = 1;
		}
	}

	if (in1_change & !(IN1CS & 0x02)) {
		IN1BC = IN1_BUFFER_SIZE; 
		in1_change = 0;
	}

	/* Start another I2C read cycle */
	/* TODO: read more than one sensor */
	i2c_start_read(I2C_PCF8591, 0);
}

static void setup_usb_int()
{
   /* disable global interrupt */
   EA       = 0;

   /* clear autovector enable */
   USBBAV   = 0x00;
#ifndef ROM_FIRMWARE
   /* clear SUDAV interrupt and all other interrupts */
   USBIRQ   = 0xff;
#endif
   /* enable SUDAV and URES interrupts */
   USBIEN   = 0x11;

#ifndef ROM_FIRMWARE
   /* clear IN0 and IN1 interrupts */
   IN07IRQ  = 0x03;
#endif
   /* enable IN0 interrupt only */
   IN07IEN  = 0x01;

#ifndef ROM_FIRMWARE
   /* clear OUT0 and OUT1 interrupt */
   OUT07IRQ = 0x03;
#endif
   /* enable OUT0 interrupt */
   OUT07IEN = 0x03;

#ifndef ROM_FIRMWARE
   /* unstall endpoints */
   IN1CS  = 0x00;
   OUT1CS = 0x00;
#endif

   /* validate endpoints */
   IN07VAL  = 3;
   OUT07VAL = 3;

   /* enable external 2 interrupt */
   EUSB = 1;

   /* enable global interrupt */
   EA   = 1;
}

static void setup_io()
{
	/* PA6, PA7 - out (motor, controllers) */
	/* all other pins on port A set to input */

	PORTACFG = 0x00;
	OUTA = 0x00;
	OEA = 0xC0;

	/* All pins on port B input (bumpers, switches) */

	PORTBCFG = 0x00;
	OUTB = 0x00;
	OEB = 0x00;

	/* RXD0,TXD0 enable, PC4,PC5 out (heartbeat) */
	/* all other pins on port C input */

	PORTCCFG = 0xcf;
	OUTC = 0x00;
	OEC = 0x30;
}

static void setup_i2c_int()
{
	/* clear INT3 interrupt */
	EXIF &= 0x10;
	/* clear I2C interrupt */
	I2CS;
	/* enable I2C interrupt */
	EIE |= 0x02;
}

static void setup_ser_int()
{

   /*
    * configure timer 1:
    * + mode 2
    * + clock divider 4
    * + SMOD 1
    * + reload value 0xd9 
    * + baud rate 9600 + 0.15%
    * + receiver disabled
    * + mode 1 (async 8N1)
    */
   TMOD     = 0x20;
   CKCON   |= 0x10;
   TH1      = 0xd9;
   PCON     = 0x80;
   SCON0    = 0x50;
   T2CON    = 0x00;

   /* enable serial port 0 interrupt */
   ES0      = 1;

   /* start timer 1 */
   TR1      = 1;
}

static void setup_timer2_int()
{
   /*
    * configure timer2:
    * + timer with auto reload
    * + rate is 250 Hz
    */
   T2CON  = 0x00;
   RCAP2H = TH2 = 0xc1;
   RCAP2L = TL2 = 0x80;

   /* enable timer 2 interrupt */
   ET2    = 1;
   /* clear timer 2 interrupt */
   TF2    = 0;
   /* start timer 2 */
   TR2    = 1;
}

static Byte i2c_wait_done(Byte check)
{
 	Byte status;

	do {
		status = I2CS;
	} while (~status & I2C_DONE);

	return ((status ^ I2C_ACK) & check);
}

static void setup_pcf8591(Byte index)
{
	while (I2CS & 0x40);

	I2CS  = I2C_START;
	I2DAT = I2C_PCF8591_ADDR | (index << 1) | I2C_WRITE;
	if (i2c_wait_done(I2C_BERR | I2C_ACK))
		goto fail_s;

	I2DAT = 0x45;	/* Enable D/A, 4 SE channels, select chan 3 */
	if (i2c_wait_done(I2C_BERR | I2C_ACK))
		goto fail_s;

	I2DAT = 0x00;	/* Output 0V on D/A */
	if (i2c_wait_done(I2C_BERR | I2C_ACK))
		goto fail_s;

fail_s:

	I2CS = I2C_STOP;
}

/*
 * _sdcc_external_startup()
 *
 * Earliest possibility to disconnect for re-enumeration.
 * This is not necessary when the firmware resides in the onboard I2C EEPROM
 * where the master control is handed back to the USB core to let it talk to
 * the host. Afterwards we perform a clean re-enumeration.
 */

Byte _sdcc_external_startup()
{
#ifndef ROM_FIRMWARE
   /* disconnect immediately */
   USBCS &= ~0x04;	/* tristate the Disconnect pin */
   USBCS |= 0x08;	/* disconnect USB core */
#endif
   return(0);
}

/*
 * main()
 *
 * Main function.
 * Call initializers, trigger re-enumeration and stay busy in endless loop.
 * All functionality is handled in the interrupt service routines.
 */

void main()
{
	int loop;

#ifndef ROM_FIRMWARE
	loop = 16384;
	while (loop-- > 0);	/* wait */
#endif

	init_variables();

	setup_usb_int();
	setup_io();

	setup_pcf8591(0);
	setup_i2c_int();

	setup_ser_int();
	setup_timer2_int();

#ifndef ROM_FIRMWARE
	USBCS |= 0x02;		/* activate RENUM */
	USBCS &= ~0x08;		/* deactivate DISCON */
	USBCS |= 0x04;		/* release tristate on Disconnect pin */
#endif

	while (1) {		/* heartbeat */
		loop = 32767;
		while (loop-- > 0);
		OUTC ^= 0x10;
	}
}
/*
 * I/O board control header file for U.C.W./Sirael Dana robot.
 *
 * Version 1.0
 *
 * Copyright (c) 2002 Vojtech Pavlik
 * Copyright (c) 2001 Arnim Laeuger
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version. See also the file COPYING which came with this
 * application.
 */

/*
 * USB descriptor types
 */

#define USB_DT_DEVICE			0x01
#define USB_DT_CONFIG			0x02
#define USB_DT_STRING			0x03
#define USB_DT_INTERFACE		0x04
#define USB_DT_ENDPOINT			0x05

/* our main data type */
typedef unsigned char Byte;

/* mapping for the setup packet */
struct setup_dat {
      Byte bmRequestType;
      Byte bRequest;
      Byte wValueL;
      Byte wValueH;
      Byte wIndexL;
      Byte wIndexH;
      Byte wLengthL;
      Byte wLengthH;
};

typedef struct setup_dat setup_dat;

/*
 * i2c defines
 */

#define I2C_START		0x80
#define I2C_STOP		0x40
#define I2C_LAST		0x20
#define I2C_BERR		0x04
#define I2C_ACK			0x02
#define I2C_DONE		0x01

#define I2C_WRITE		0x00
#define I2C_READ		0x01
#define I2C_PCF8591_ADDR	0x90
#define I2C_MAX127_ADDR		0x28
#define I2C_MAX1236_ADDR	0x34

#define I2C_PCF8591		0
#define I2C_MAX127R		1
#define I2C_MAX127W		2
#define I2C_MAX1236		3

/*
 * Other defines
 */

#define MISC_BUFFER_SIZE 8
#define I2C_BUFFER_SIZE 16
#define TX_BUFFER_SIZE	32
#define IN1_BUFFER_SIZE (MISC_BUFFER_SIZE+I2C_BUFFER_SIZE)

/*
 * global variables
 */

/* i2c data buffer */

static data int beat;

static data Byte i2c_buffer[I2C_BUFFER_SIZE];
static data Byte tx_buffer[TX_BUFFER_SIZE];

static data Byte i2c_mode;
static data Byte i2c_state;
static data Byte i2c_index;

static data Byte tx_head;
static data Byte tx_tail;
static bit tx_running;

/*
 * USB related stuff
 */

/* report has changed, in1buf should be transferred on the next opportunity */
static bit in1_change;

/* busy semaphore for IN1 endpoint */
static bit in1_busy;                 /* apply_reset_values */

/* the device descriptor */
static code Byte dev_desc[] = {
   0x12, // bLength             : Length of Descriptor
   0x01, // bDescriptorType     : Descriptor Type = Device
   0x10, // bcdUSB (L)          : USB Specification Version 1.00 (L)
   0x01, // bcdUSB (H)          : USB Specification Version 1.00 (H)
   0xff, // bDeviceClass        : Device Class (0xff is Vendor Specific)
   0xff, // bDeviceSubClass     : Device Sub-Class (0xff is Vendor Specific)
   0xff, // bDeviceProtocol     : Device Protocol (0xff is Vendor Specific)
   0x40, // bMaxPacketSize0     : Maximum Packet Size for EP0
   0xbe, // idVendor (L)        : Vendor ID (L)
   0xba, // idVendor (H)        : Vendor ID (H)
   0x04, // idProduct (L)       : Product ID (L)
   0x00, // idProduct (H)       : Product ID (H)
   0x00, // bcdDevice (L)       : Device Release Number (BCD,L)
   0x01, // bcdDevice (H)       : Device Release Number (BCD,H)
   0x01, // iManufacturer       : Manufacturer Index String
   0x02, // iProduct            : Product Index String
   0x00, // iSerialNumber       : Serial Number Index String
   0x01  // bNumConfigurations  : Number of Configurations in this Device
};

/* the configuration descriptor */
static code Byte conf_desc[] = {
   0x09, // bLength             : Length of Descriptor
   0x02, // bDescriptorType     : Descriptor Type = Configuration
   0x20, // wTotalLength (L)    : Total Length (L) including Interface and Endpoint
   0x00, // wTotalLength (H)    : Total Length (H)
   0x01, // bNumInterfaces      : One Interface in this Configuration
   0x01, // bConfigurationValue : Configuration Value Used by Set_Configuration Request
         //                       to Select this Configuration
   0x00, // iConfiguration      : Index of String Describing this Configuration
   0x80, // bmAttributes        : Attributes
   0x64, // MaxPower            : Maximum Power

   //
   // The interface descriptor
   //

   // Interface 0, alternate setting 0
   0x09, // bLength             : Length of Descriptor
   0x04, // bDescriptorType     : Descriptor Type = Interface
   0x00, // bInterfaceNumber    : Zero-based index of this Interface
   0x00, // bAlternateSetting   : Alternate Setting
   0x02, // bNumEndpoints       : Number of Endpoints in this Interface
   0xff, // bInterfaceClass     : Interface Class
   0xff, // bInterfaceSubClass  : Interface Sub-Class (boot interface)
   0xff, // bInterfaceProtocol  : Interface Protocol (keyboard)
   0x00, // iInterface          : Index to String Descriptor for this Interface
   
   // Endpoint Descriptor
   0x07, // bLength             : Length of Descriptor
   0x05, // bDescriptorType     : Descriptor Type = Endpoint
   0x81, // bEndpointAddress    : Endpoint Address
   0x03, // bmAttributes        : Endpoint Attributes = INT
   0x40, // wMaxPacketSize (L)  : Maximum Packet Size (L)
   0x00, // wMaxPacketSize (H)  : Maximum Packet Size (H)
   0x05, // bInterval           : Polling intervall in Milliseconds

   // Endpoint Descriptor
   0x07, // bLength             : Length of Descriptor
   0x05, // bDescriptorType     : Descriptor Type = Endpoint
   0x01, // bEndpointAddress    : Endpoint Address
   0x03, // bmAttributes        : Endpoint Attributes = INT
   0x08, // wMaxPacketSize (L)  : Maximum Packet Size (L)
   0x00, // wMaxPacketSize (H)  : Maximum Packet Size (H)
   0x05  // bInterval           : Polling intervall in Milliseconds

};

/* language ID string descriptor */
static code Byte string_langid[] = { 0x04, 0x03, 0x00, 0x00 };

/* manufacturer string descriptor */
static code Byte string_mfg[] = {
   0x1f, 0x03,
   'U',0, '.',0, 'C',0, '.',0, 'W',0, '.',0, ' ',0, '/',0,
   ' ',0, 'S',0, 'i',0, 'r',0, 'a',0, 'e',0, 'l',0
};

/* product string descriptor */
static code Byte string_prod[] = {
   0x1c, 0x03,
   'D',0, 'a',0, 'n',0, 'a',0, ' ',0, 'I',0, '/',0, 'O',0,
   ' ',0, 'U',0, 'n',0, 'i',0, 't',0
};

#define NUM_STRING 3

static data unsigned int string_index[NUM_STRING] = {
   (unsigned int)string_langid,
   (unsigned int)string_mfg,
   (unsigned int)string_prod
};

/*
 * global pointers
 */
#define in0buf(n)  (&IN0BUF)[n]
#define in1buf(n)  (&IN1BUF)[n]
#define out0buf(n) (&OUT0BUF)[n]
#define out1buf(n) (&OUT1BUF)[n]
static xdata setup_dat * data sdat = (xdata setup_dat *)&SETUPDAT;
/*
 *
 * $Id: ezusb_reg.h,v 1.2 2003/01/10 17:03:08 vojtech Exp $
 *
 * Change History:
 *
 * $Log: ezusb_reg.h,v $
 * Revision 1.2  2003/01/10 17:03:08  vojtech
 * Versio 0.06: Input works.
 *
 * Revision 1.1  2003/01/09 15:02:13  vojtech
 * Firmware for the EzUSB I/O board.
 *
 * Revision 1.3  2002/03/03 23:35:32  arniml
 * add TOGCTL
 *
 * Revision 1.2  2001/08/15 18:24:03  arniml
 * added some register definitions for serial port 1 and IN2 endpoint
 *
 * Revision 1.1.1.1  2001/07/14 15:32:37  arniml
 * initial import
 *
 *
 */


sbit  at 0xe8 EUSB;
sbit  at 0xac ES0;
sbit  at 0xae ES1;
sbit  at 0x98 RI_0;
sbit  at 0x99 TI_0;
sbit  at 0xc0 RI_1;
sbit  at 0xc1 TI_1;
sbit  at 0xca TR2;
sbit  at 0xcf TF2;
sbit  at 0xad ET2;

sfr   at 0x91 EXIF;
sfr   at 0xe8 EIE;
sfr   at 0x98 SCON0;
sfr   at 0xc0 SCON1;
sfr   at 0x99 SBUF0;
sfr   at 0xc1 SBUF1;
sfr   at 0x8e CKCON;
sfr   at 0xc8 T2CON;
sfr   at 0xca RCAP2L;
sfr   at 0xcb RCAP2H;
sfr   at 0xcc TL2;
sfr   at 0xcd TH2;

xdata at 0x7fb4 unsigned char EP0CS;
xdata at 0x7f00 unsigned char IN0BUF;
xdata at 0x7fb5 unsigned char IN0BC;
xdata at 0x7ec0 unsigned char OUT0BUF;
xdata at 0x7fc5 unsigned char OUT0BC;

xdata at 0x7fb6 unsigned char IN1CS;
xdata at 0x7e80 unsigned char IN1BUF;
xdata at 0x7fb7 unsigned char IN1BC;
xdata at 0x7e40 unsigned char OUT1BUF;
xdata at 0x7fc6 unsigned char OUT1CS;
xdata at 0x7fc7 unsigned char OUT1BC;

xdata at 0x7e00 unsigned char IN2BUF;
xdata at 0x7fb9 unsigned char IN2BC;
xdata at 0x7fb8 unsigned char IN2CS;
xdata at 0x7fc9 unsigned char OUT2BC;
xdata at 0x7fc8 unsigned char OUT2CS;
xdata at 0x7dc0 unsigned char OUT2BUF;
xdata at 0x7d00 unsigned char IN4BUF;
xdata at 0x7fbd unsigned char IN4BC;
xdata at 0x7fbc unsigned char IN4CS;
xdata at 0x7f93 unsigned char PORTACFG;
xdata at 0x7f94 unsigned char PORTBCFG;
xdata at 0x7f95 unsigned char PORTCCFG;
xdata at 0x7f96 unsigned char OUTA;
xdata at 0x7f97 unsigned char OUTB;
xdata at 0x7f98 unsigned char OUTC;
xdata at 0x7f99 unsigned char PINSA;
xdata at 0x7f9a unsigned char PINSB;
xdata at 0x7f9b unsigned char PINSC;
xdata at 0x7f9c unsigned char OEA;
xdata at 0x7f9d unsigned char OEB;
xdata at 0x7f9e unsigned char OEC;

xdata at 0x7fa9 unsigned char IN07IRQ;
xdata at 0x7faa unsigned char OUT07IRQ;
xdata at 0x7fac unsigned char IN07IEN;
xdata at 0x7fad unsigned char OUT07IEN;
xdata at 0x7fab unsigned char USBIRQ;
xdata at 0x7fae unsigned char USBIEN;

xdata at 0x7faf unsigned char USBBAV;
xdata at 0x7fd6 unsigned char USBCS;
xdata at 0x7fd7 unsigned char TOGCTL;
xdata at 0x7fd4 unsigned char SUDPTRH;
xdata at 0x7fd5 unsigned char SUDPTRL;
xdata at 0x7fe8 unsigned char SETUPDAT;
xdata at 0x7fa5 unsigned char I2CS;
xdata at 0x7fa6 unsigned char I2DAT;
xdata at 0x7fde unsigned char IN07VAL;
xdata at 0x7fdf unsigned char OUT07VAL;
xdata at 0x7fe3 unsigned char AUTOPTRH;
xdata at 0x7fe4 unsigned char AUTOPTRL;
xdata at 0x7fe5 unsigned char AUTODATA;

Home | Main Index | Thread Index