PAK-VIIIa Pulse Coprocessor Data Sheet by AWC

Similar documents
PAK-Vb/c PWM Coprocessor Data Sheet by AWC

GP4 PC Servo Control Kit 2003 by AWC

Built-in LCD display RAM Built-in RC oscillator

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

PATENTED. PAT No. : HT1622/HT1622G RAM Mapping 32 8 LCD Controller for I/O MCU. Features. General Description.

PATENTED. PAT No. : HT1622/HT1622G RAM Mapping 32 8 LCD Controller for I/O MCU. Features. General Description.

Block Diagram , E I F = O 4 ) + J H 6 E E C + E H? K E J +,, H E L A H * E = I + E H? K E J + + % 8,, % 8 +, * * 6 A. H A G K A? O

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

Built-in LCD display RAM Built-in RC oscillator

RAM Mapping LCD Controller for I/O MCU. Built-in LCD display RAM Built-in RC oscillator

LS7362 BRUSHLESS DC MOTOR COMMUTATOR / CONTROLLER

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function

R/W address auto increment External Crystal kHz oscillator

Serial Communication AS5132 Rotary Magnetic Position Sensor

RAM Mapping 64 8 LCD Controller for I/O MCU. Built-in LCD display RAM Built-in RC oscillator

RAM Mapping 32 8 LCD Controller for I/O MCU. R/W address auto increment Built-in RC oscillator

HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM

Embedded Systems and Software

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

RAM Mapping 48 8 LCD Controller for I/O C

RAM Mapping 48 8 LCD Controller for I/O MCU. Built-in LCD display RAM Built-in RC oscillator

Crystalfontz. RAM Mapping 64 8 LCD Controller for I/O MCU. Built-in LCD display RAM Built-in RC oscillator

HT1621. HT1621 RAM Mapping 32x4 LCD Controller for I/O MCU

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

LSI/CSI LS7290 STEPPER MOTOR CONTROLLER. LSI Computer Systems, Inc Walt Whitman Road, Melville, NY (631) FAX (631)

HB-25 Motor Controller (#29144)

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

HT9020. Call Progress Tone Decoder & ABR Controller. Features. General Description. Selection Table

Application Manual. AB-RTCMC kHz-B5ZE-S3 Real Time Clock/Calendar Module with I 2 C Interface

PWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

RW1026 Dot Matrix 48x4 LCD Controller / Driver

A Sequencing LSI for Stepper Motors PCD4511/4521/4541

RB-Dev-03 Devantech CMPS03 Magnetic Compass Module

RV-8564 Application Manual. Application Manual. Real-Time Clock Module with I 2 C-Bus Interface. October /62 Rev. 2.1

Pulse Generation. Pulsout. 555 Timer. Software version of pulse generation Pulsout pin, Period

The ST7588T is a driver & controller LSI for graphic dot-matrix liquid crystal display systems. It contains 132 segment and 80

MD04-24Volt 20Amp H Bridge Motor Drive

SKY2000. Data Sheet DUAL-TRACK MAGNETIC STRIPE F2F DECODER IC. For More Information. Solution Way Co., Ltd

Castle Creations, INC.

EDE1204 Bi-Polar Stepper Motor IC

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

Project Final Report: Directional Remote Control

S-35190A 3-WIRE REAL-TIME CLOCK. Features. Applications. Packages. ABLIC Inc., Rev.4.2_03

Sequential Logic Circuits

Freescale Semiconductor, I

PATENTED. HT1621/HT1621G RAM Mapping 32 4 LCD Controller for I/O MCU. PAT No. : TW Features. General Description.

Hitachi HM55B Compass Module (#29123)

S-35390A H Series FOR AUTOMOTIVE 105 C OPERATION 2-WIRE REAL-TIME CLOCK. Features. Packages. ABLIC Inc., Rev.2.

Programming the Dallas/Maxim DS MHz I2C Oscillator. Jeremy Clark

SHT28C21: SHT28D21: 28-pin SOP package

Feed-back loop. open-loop. closed-loop

EE 314 Spring 2003 Microprocessor Systems

Lab Exercise 9: Stepper and Servo Motors

SERIALLY PROGRAMMABLE CLOCK SOURCE. Features

Using the Z8 Encore! XP Timer

CMOS Serial Digital Pulse Width Modulator INPUT CLK MODULATOR LOGIC PWM 8 STAGE RIPPLE COUNTER RESET LOAD FREQUENCY DATA REGISTER

MD03-50Volt 20Amp H Bridge Motor Drive

S-35392A 2-WIRE REAL-TIME CLOCK. Features. Applications. Package. ABLIC Inc., Rev.3.2_03

Servos A Brief Guide

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Need Analog Output from the Stamp? Dial it in with a Digital Potentiometer Using the DS1267 potentiometer as a versatile digital-to-analog converter

DATA SHEET. PCD pixels matrix LCD controller/driver INTEGRATED CIRCUITS Apr 12

LM2240 Programmable Timer Counter

PRODUCT OVERVIEW OVERVIEW OTP

DS4000 Digitally Controlled TCXO

B Robo Claw 2 Channel 25A Motor Controller Data Sheet

LSI/CSI LS8397 STEPPER MOTOR CONTROLLER. LSI Computer Systems, Inc Walt Whitman Road, Melville, NY (631) FAX (631)

AppKit: Using the LTC bit Analog-to-Digital Converter

Adafruit 16-Channel PWM/Servo HAT & Bonnet for Raspberry Pi

Sequential Logic Circuits

HT9200A/HT9200B DTMF Generators

Autonomous Refrigerator. Vinícius Bazan Adam Jerozolim Luiz Jollembeck

Freescale Semiconductor, I

Adafruit 16-Channel PWM/Servo HAT for Raspberry Pi

AVR PWM 11 Aug In the table below you have symbols used in the text. The meaning of symbols is the same in the entire guide.

CMOS Serial Digital Pulse Width Modulator INPUT CLK MODULATOR LOGIC PWM 8 STAGE RIPPLE COUNTER RESET LOAD FREQUENCY DATA REGISTER

SH X Grayscale Dot Matrix OLED/PLED Driver with Controller. Features. General Description 1 V2.2

um-pwm1 Pulse-width Modulation Servo Coprocessor Datasheet Release V100 Introduction Features Applications

Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett

DASL 120 Introduction to Microcontrollers

20-, 40-, and 60-Bit I/O Expander with EEPROM

LV8716QAGEVK Evaluation Kit User Guide

BV4112. Serial Micro stepping Motor Controller. Product specification. Dec V0.a. ByVac Page 1 of 18

DS1202, DS1202S. Serial Timekeeping Chip FEATURES PIN ASSIGNMENT. ORDERING INFORMATION DS pin DIP DS1202S 16 pin SOIC DS1202S8 8 pin SOIC

Once the DS1821 comes up as a thermostat it will not return to 1-wire mode until it receives a special signal sequence, as follows:

75T2089/2090/2091 DTMF Transceivers

CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 8: I/O INTERFACING QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS

I-7088, I-7088D, M-7088 and M-7088D User Manual

Devantech Magnetic Compass on I2C

Roland Kammerer. 13. October 2010

Low Phase Noise, LVPECL VCXO (for 150MHz to 160MHz Fundamental Crystals) FEATURES. * Internal 60KΩ pull-up resistor

Pololu TReX Jr Firmware Version 1.2: Configuration Parameter Documentation

DTMF receiver for telephones

Serial Servo Controller

DS1075. EconOscillator/Divider PRELIMINARY FEATURES PIN ASSIGNMENT FREQUENCY OPTIONS

Transcription:

PAK-VIIIa Pulse Coprocessor Data Sheet 2000-2003 by AWC AWC 310 Ivy Glen League City, TX 77573 (281) 334-4341 http://www.al-williams.com/awce.htm V1.6 30 Aug 2003

Table of Contents Overview...1 If You Need Help...2 Pin Connections...3 Command Format...4 Resetting the PAK...6 Registers...7 Special Commands...8 Software...10 Example Circuit...11 Using the PAK-VIII for PWM...11 Using the PAK-VIII for Servo Control...11 Frequently Asked Questions...12 Q: Can I use a different clock?...12 Q: I'm writing my own ShiftIn and ShiftOut instructions to communicate with the PAK. How fast can I go?...12 Q: How accurate are the pulse widths generated?...12 Q: How do I connect the resonator?...13 NotesNotesSpecifications...14 NotesSpecifications...15 Specifications...16 Absolute Maximum Ratings...16

Overview The PAK-VIII is an 8 channel pulse output coprocessor. It can perform a variety of functions: Generate pulses continuously Generate a certain number of pulses and then stop Create pulses with varying duty cycles Count generated rising edges or falling edges Control servos Generate PWM Works with Basic Stamp's SHIFTIN and SHIFTOUT Easy to use Like all PAKs, the PAK-VIII is simple to connect to a Stamp or any microcontroller. If your microcontroller can switch pins between input and output status, you can connect a single PAK with as few as 2 I/O lines. However, the PAK will allow you to use separate I/O pins (3 lines) if necessary. You can also connect multiple PAKs together using the same two or three lines if you provide an additional enable line for each PAK. The PAK-VIII is a standard 28-pin IC. In order to operate, it must have a regulated supply of 5V and connection to a clock element. The PAK-VIII includes a 50MHz ceramic resonator that you can use to clock the chip. If you need more accuracy, a crystal or external oscillator may be used. 1

If You Need Help If you require assistance with your PAK VIIIa, please feel free to contact us. For best support, e-mail stamp@al-williams.com. However, you may also call between 9AM - 4PM Central Time at (281) 334-4341. You can also fax to (281) 754-4462. Be sure to check out our Web page for updates at www.alwilliams.com/awce.htm. Vss Vdd N/C Vss N/C ENABLE CLK SIN SOUT P0 P1 P2 P3 P4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 PAK-VIIIa 28 27 26 25 24 23 22 21 20 19 18 17 16 15 RESET RES1 RES2 C7 C6 C5 C4 C3 C2 C1 C0 P7 P6 P5 WARNING: The PAK VIII is a static-sensitive, CMOS device. Observe static precautions when handling. Operating the device without both Vss pins grounded or with RES1 or RES2 disconnected may damage the chip. 2

Pin Name Type Pin Connections Description 1 Vss Power Ground 2 Vdd Power +5V 3, 5 N/C N/C No connection 4 Vss Power Ground 6 Enable Input If this pin is not connected or high, the PAK is active. Otherwise, the PAK does not drive the SOUT line, nor does it respond to commands. 7 CLK Input Used to clock data to and from the PAK. 8 SIN Input Data Input 9 SOUT Open Collector Output 10 to P0-P7 Outputs 17 18 to C0-C7 Outputs 25 Data Output Pulse output channels Clock output channels 26 RES1 Clock Connects to resonator (75MHz max) 27 RES2 Clock Connects to resonator 28 RESETInput Hardware resets the PAK when low. Must be high for normal operation. 3

Command Format The PAK-VIII uses a very simple command byte. Each channel (P0 to P7) has 6 associated registers. To write a register you form a single byte with the following bits: 7 6 5 4 3 2 1 0 0 0 R2 R1 R0 C2 C1 C0 e: R2-R0 is the register number from the table below. C2-C0 is the channel number in binary (0=000, 1=001, 2=010, 3=011, 4=100, 5=101, 6=110, 7=111). Here are the available registers: Register numbername Function Units (prescale normal) 000 (0) DUR Current pulse duration 10uS 001 (1) DURHIGH Duration of high part of output10us 010 (2) DURLOW Duration of low part of output 10uS 101 (5) COUNT Number of pulses to generate 110 (6) CTRL Sets modes (count and enable) Each time you send a register write command (bit 7 and 6 both = 0) to the PAK, it expects two bytes. The first byte is the least significant byte of a 16-bit word. The second byte is the most significant byte. Bytes are sent most significant bit first. You can 4

find more details about the PAK protocol (including example code) at http://www.al-williams.com/doclib.htm. In addition to the write command, you can use the following special commands: Command Description 11111111 Reset everything 1100PPPP Set prescaler (affects all timing functions) PPPP = 0000 = 1:2 (default; 10uS) PPPP = 0001 = 1:4 (20uS) PPPP = 0010 = 1:8 (40uS) PPPP = 0011 = 1:16 (80uS) PPPP = 0100 = 1:32 (160uS) PPPP = 0101 = 1:64 (320uS) PPPP = 0110 = 1:128 (640uS) PPPP = 0111 = 1:256 (1280uS) PPPP = 1000 = 1:1 (not useful when using more than 4 channels; 5uS) 010XXCCC Sets status of channel CCC: XX = 00 = Force low XX = 01 = Force high XX = 10 = Hi impedance state (default) XX = 11 = Pulse output operation 5

Command Description 10RRRCCC Read register RRR (two bytes sent back to host; least significant first). 11111110 Disable all output and reset all counters 11111101 Enable outputs (default state; disabling the PAK, setting all channels, and then enabling allows you to sync the leading edges of the pulse outputs, if required) Resetting the PAK There are three ways you might reset the PAK-VIII. When you start, your host microcontroller might take a short time to take control of the PAK's I/O lines. That's why it is important to initially reset the PAK's communications system. Resetting the communications system is easy. Simply pull the SIN line low and raise the CLK input. Then, while CLK is high, raise SIN. When you release the clock, the PAK will reset its communications. This does not affect any running counters or timers. It also does not reset any options (for example, pull up resistors). You can perform this reset using the FReset subroutine included with the example Basic Stamp library. If you want to force a hard reset, which will clear all of the aforementioned items, send the PAK a $FF or use the library's FTotalReset command. Another way to force a hard reset is to pull the RESET pin low briefly and then restore it to high. This will physically reset the PAK-VIII, destroying any settings, counts, or intervals in progress. Notice that most of the time this is not necessary so there is no need to connect the RESET pin to the host microcontroller. Simply connect it to +5V. 6

Registers Each channel has several identical 16-bit registers. These register control the PAK's operation. Initially, all channels are disabled and set to high impedance state. This allows your program time to set the registers before enabling the outputs. Register 1 sets the duration of the high-going part of the pulse. Register 2 sets the duration of the low-going part of the pulse. With the default prescaler setting, these registers operate in 10uS intervals. However, you can alter the prescaler to change this. Register 0 tracks the current amount of time for the current half cycle -- you'll rarely need to access this register. Register 6 is the control register. This register really only uses 3 bits. The bottom bit (bit 0) determines if the channel is enabled (a 0 means that it is enabled). Bit 1 is set if the PAK is to output a certain number of pulses and then stop. Finally, bit 7 shows the current state of the output pin (read-only). If counting is enabled (bit 1 in register 6 is set) then the PAK examines register 5. The PAK treats the register as a flag in bit 15 followed by a 15-bit counter. If the flag is clear (that is to say the number is <$8000) then the PAK generates the requested number of high pulses when the channel is enabled. Register 5 counts down to 0 and at the end, the output will be low. If register 5 has bit 15 set (that is the number is >$8000), the PAK counts the low pulses. In this case, the counter counts down to $8000 and at the end the output will be high. You can read the counter register (register 5) to determine if the PAK has completed the pulse train or is still generating pulses. You can access these registers by forming the appropriate request byte and sending it to the PAK. The example Basic Stamp library has a function, FCommand, that makes this easier. To use FCommand, set Register to the register number you want and Chan 7

to the channel number. The value you wish to store is in the fpx variable. The routines do not change the input variables, so if you set register to 0, for example, you don't have to set it again until you want to change its value no matter how many calls to FCommand you make. Special Commands In addition to reading registers, you may execute special commands. Sending all 1's to the PAK, as mentioned before, causes a hard reset. This will terminate and reset all pulse functions. It also resets all options including prescaling. If you need to generate pulses longer than the maximum allowed, you can reduce the speed of the PAK using a slower ceramic resonator or crystal. However, an easier solution is to engage the prescaler. Using the prescaler, you can change the time base from 5uS to 10uS to 1280uS in 8 steps. This changes the time for all channels. The default setting for the prescaler to 1:2. This means that all pulse widths are normally in units of 10uS. You can reduce to 1:1 for 5uS resolution. However, when doing so, the PAK can only service 4 channels at once. You can enable any 4 channels, but enabling more than 4 with a 1:1 prescale will cause inaccuracy in the generated pulses. The prescaler also determines how long a pulse you can generate. Since each register is 16-bit, at 10uS, the largest high (or low) you can generate is just over 650mS. You can set the prescaler using the Basic Stamp library's FPrescale function (set fpb to the correct prescale code you want to use). The prescale command does not return any data to the host. 8

The other special commands allow you to force a channel to a certain state, or read a register. You can force a channel to be a high impedance pin, a logic 0, or a logic 1. Setting any of these states automatically disables the channel in question. Setting the normal state automatically enables the channel. By default, pins C0-C7 are weakly pulled up to 5V. However, you can write to the low byte of register 7 channel 1 to cause a repeating clock to appear on these pins. A 0 in the corresponding bit positions will enable the clock output bits. C0 will cycle at the sample rate (10uS by default), C1 will cycle at double that time (20uS), C2 doubles C1 (40us), etc. 9

Software If you are using the Basic Stamp II or IISX, you can use the simple library included on the companion disk to work with the PAK- VIII. You'll need to change the DATAP, DATAPIN, and CLK variables to match your circuit. Here are the available subroutine calls: Call Arguments Description FCommand chan = channel number Set register register = register number fpx = value FReset none Reset PAK I/O FTotalReset none Completely reset PAK FPrescale fpb=pppp Set prescale ratio FreadReg FJam chan = channel number register = register number chan = channel number fpb = two bit code Returns value in fpx Set state (00 = low; 01 = high; 10 = hi-z; 11 = normal) 10

Example Circuit 5V Connections to Host 10 to 22K Clock Data 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Vss Vdd N/C Vss N/C ENABLE CLK SIN SOUT P0 P1 P2 P3 P4 PAK-VIIIa RESET RES1 RES2 C7 C6 C5 C4 C3 C2 C1 C0 P7 P6 P5 28 27 26 25 24 23 22 21 20 19 18 17 16 15 Resonator Typical Circuit Using the PAK-VIII for PWM The PAK-VIII can easily generate pulses appropriate for Pulse Width Modulation (PWM). The ratio of the high and low durations will determine the PWM output. For example, if you turn a pulse on for 10uS and off for 30uS that will be a duty cycle of 25% (10 divded by 10+30). If you turn the pulse on for 20uS and off for 20uS that is a 50% duty cycle. PWM is useful for generating voltages (with an RC integrator) and for controlling heating elements, motors, and similar devices. Using the PAK-VIII for Servo Control The PAK-VIII can also easily control servo motors. Servos operate by altering their position based on a pulse width. Usually a 1.5mS pulse will center the servo. Shorter pulses cause the servo to move in one direction. Longer pulses reverse the direction. The servo's final position depends on the pulse width. 11

It is simple to center a servo by turning a pulse "on" for 150 units (assuming the default 10uS prescale is in force). You can turn the pulse "off" for a longer time, perhaps 20mS (a count of 2000). Then by adjusting the "on" time, you can control the servo position easily. Once set, the PAK-VIII will continue to supply the control pulses without further intervention from the host computer. This can be especially useful when using servos modified for continuous rotation. Combined with the counting function of the PAK-VIII you can deliver a preset number of pulses to the servo with a single command sequence from the host. Frequently Asked Questions Q: Can I use a different clock? A: Yes, you can use a different ceramic resonator or crystal to change the speed of the PAK-VIII. Reducing the speed will reduce the power required, and also stretch the pulse duration. A 25MHz resonator, for example, will generate pulses in 20uS intervals (by default; the prescaler may adjust this). The maximum frequency of operation is 75MHz. Q: I'm writing my own ShiftIn and ShiftOut instructions to communicate with the PAK. How fast can I go? A: The Stamp II's ShiftIn and ShiftOut instructions operate at about 16kHz. However, with a 50MHz resonator, the PAK should operate fine when the CLK line operates at 100kHz. Q: How accurate are the pulse widths generated? A: The pulse widths are as accurate as the timing element connected. For the ceramic resonator supplied, that is reasonably accurate. However, you can replace the reasonator with a 50MHz crystal (and appropriate capacitors) to improve the accuracy if you wish. Remember too that the time it takes you to communicate 12

with the PAK is a factor as well. Using a Stamp II, reading or writing 16 bits from the PAK takes about 1mS. Q: How do I connect the resonator? A: The middle pin is ground. The outer pins are interchangeable. 13

Notes 14

Notes 15

Specifications Absolute Maximum Ratings Ambient temperature under bias Storage temperature -40 C to +85 C -65 C to +150 C Voltage on VDD with respect to VSS 0 to +7.0V Maximum current out of VSS pin Maximum current into VDD pin 130 ma 130 ma DC Characteristics Parameter Minimum Typical Maximum Supply voltage 3V 5V 5.5V Vdd rise time on power up.05v/ms - - Supply current @ 5V/50MHz - 77mA 16