6522 Shift Register & Servos
6522 Shift Register & Servos
Has anyone on this board tried using the 6522 Shift register to control a servo?
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: 6522 Shift Register & Servos
I have not, but it's an interesting idea. I've used PA or PB bits to control model-aircraft servos. The pulse width they need is 0.5 to 2.5ms IIRC, to span their range. Duty cycle didn't matter. It was the width of the pulse that mattered, not the space between pulses.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: 6522 Shift Register & Servos
Technically, yes: The speaker in a PET, assuming you mean servo motor, not a whole servo loop.
Re: 6522 Shift Register & Servos
What is it you have in mind, Gord -- a project of some kind?
I've used a VIA shift register to interface to a printer that used servos, but the shift register wasn't part of the servo loop. Not what you were contemplating, I suspect...
The VIA shift register can be used as an unusual and very simple, 9-level DAC. Garth explains this here (about 70% of the way down the page. Look for, "9-level D/A converter").
For normal digital I/O, the shift register is comparable to a parallel interface. AFAIK the only real difference is increased latency. The SR can be clocked at 50% of the Phase2 rate -- IOW 16 cycles per byte.
I've used a VIA shift register to interface to a printer that used servos, but the shift register wasn't part of the servo loop. Not what you were contemplating, I suspect...
The VIA shift register can be used as an unusual and very simple, 9-level DAC. Garth explains this here (about 70% of the way down the page. Look for, "9-level D/A converter").
For normal digital I/O, the shift register is comparable to a parallel interface. AFAIK the only real difference is increased latency. The SR can be clocked at 50% of the Phase2 rate -- IOW 16 cycles per byte.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: 6522 Shift Register & Servos
The Signetics 543 Servo Amplifier was based on a 1.5ms pulse width for center position and with proper 5K feedback potentiometer had a 100 degree rotation from 1ms to 2ms. The data sheet also states the positioning pulse occurs at 16ms intervals, or about 60 times per second.
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
Re: 6522 Shift Register & Servos
Thanks for the replies...
I was considering using the Shift Register to control the servo motors on a robotic arm. Not sure if this would work, but thought I would give it a try. Will I have enough control over the pulse width?
I was considering using the Shift Register to control the servo motors on a robotic arm. Not sure if this would work, but thought I would give it a try. Will I have enough control over the pulse width?
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: 6522 Shift Register & Servos
apatco wrote:
Thanks for the replies...
I was considering using the Shift Register to control the servo motors on a robotic arm. Not sure if this would work, but thought I would give it a try. Will I have enough control over the pulse width?
I was considering using the Shift Register to control the servo motors on a robotic arm. Not sure if this would work, but thought I would give it a try. Will I have enough control over the pulse width?
Using the VIA's synchronous-serial port as a 9-level D/A converter is adequate for an analog output for something like DTMF or like toy-quality voice, but may not be nearly good enough for what you're talking about, if indeed you even wanted an analog voltage to work with. OTOH, if you want to send bytes out the port, it's an easy way to get hundreds of bits of I/O while taking up only two or three pins of the VIA, as shown in the 6502 Primer's potpourri page, particularly at the section titled "Using the 6522's shift register for tons of output bits."
But if you want a given length of pulses on lots of output pins (for lots of servos) and can't afford to have the computer doing nothing else useful while its counting out a pulse time, it might work well to do each pulse as a task in a multitasking arrangement with no multitasking OS. Three ways to do this are described in the 6502-oriented article, "Simple methods for multitasking without a multitasking OS, for systems that lack the resources to implement a multitasking OS, or where hard realtime requirements would rule one out anyway." If you don't need pulses timed simultaneously, you might be able to have a single task take care of all of them, and it would know from its state variable which output bit (if any) it's supposed to be working on at the moment.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: 6522 Shift Register & Servos
The official servo servo pulse specification (derived from the PPM signal) is 750us to 2250us. However, most hobby servos only handle 850us to 2150us. The frame rate is typically 22ms, but can be as low as 10ms for analog servos, and special servos (typically digital) handle as low as 3ms frames. You generally can not have frames longer than about 35ms or the servo stops updating the position.