isp1161bm NXP Semiconductors, isp1161bm Datasheet - Page 34

no-image

isp1161bm

Manufacturer Part Number
isp1161bm
Description
Isp1161 Full-speed Universal Serial Bus Single-chip Host And Device Controller
Manufacturer
NXP Semiconductors
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ISP1161BM
Manufacturer:
NXP
Quantity:
10 000
Philips Semiconductors
9397 750 09567
Product data
// The example program for writing ATL buffer RAM
#include <conio.h>
#include <stdio.h>
#include <dos.h>
// Define register commands
#define wHcTransferCounter 0x22
#define wHcuPInterrupt 0x24
#define wHcATLBufferLength 0x2b
#define wHcBufferStatus 0x2c
// Define I/O Port Address for HC
#define HcDataPort 0x290
#define HcCmdPort 0x292
// Declare external functions to be used
unsigned int HcRegRead(unsigned int wIndex);
void HcRegWrite(unsigned int wIndex,unsigned int wValue);
void main(void)
{
unsigned int i;
unsigned int wCount,wData;
// Prepare PTD data to be written into HC ATL buffer RAM:
unsigned int PTDData[0x28]=
{
0x0800,0x1010,0x0810,0x0005, // PTD header for IN token #1
// Reserved space for payload data of IN token #1
0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
0x0800,0x1008,0x0808,0x0005, // PTD header for IN token #2
// Reserved space for payload data of IN token #2
0x0000,0x0000,0x0000,0x0000,
0x0800,0x1010,0x0410,0x0005, // PTD header for OUT token #1
0x0100,0x0302,0x0504,0x0706, // Payload data for OUT token #1
0x0908,0x0b0a,0x0d0c,0x0f0e,
0x0800,0x1808,0x0408,0x0005, // PTD header for OUT token #2
0x0200,0x0604,0x0a08,0x0e0c // Payload data for OUT token #2
};
HcRegWrite(wHcuPInterrupt,0x04); // Clear EOT interrupt bit
// HcRegWrite(wHcITLBufferLength,0x0);
HcRegWrite(wHcATLBufferLength,0x1000); // RAM full use for ATL
// Set the number of bytes to be transferred
HcRegWrite(wHcTransferCounter,0x50);
wCount = 0x28; // Get word count outport
(HcCmdPort,0x00c1); // Command for ATL buffer write
// write 80 (0x50) bytes of data into ATL buffer RAM
for (i=0;i<wCount;i++)
Rev. 02 — 13 December 2002
Full-speed USB single-chip host and device controller
© Koninklijke Philips Electronics N.V. 2002. All rights reserved.
ISP1161
34 of 137

Related parts for isp1161bm