Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | slow (16-50kHz) shiftin & shiftout

Discussion forum for the BasicX family of microcontroller chips.

slow (16-50kHz) shiftin & shiftout - Author Unknown - Feb 28 2:06:00 2001

I'm trying to talk to an AWC PAK7 pulse coprocessor (http://www.al-
williams.com/awce/pak7.htm) and it calls for the use of shiftin and
shiftout to do the talking ... but the clock speed is limited to no
more than 100kHz. Default for shifting data with a Stamp2 is 16kHz.

Is there a way to slow the BX-24 shift instructions down (default
400kHz) or a quick 'n dirty set of subroutines out there that mimic
the standard shiftin/out that would accomplish the same goal?

Thanks much,
Larry Goodhind
Redmond, WA





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: slow (16-50kHz) shiftin & shiftout - Tony Brenke - Feb 28 5:09:00 2001

you can make your own.
or
you can shift out one bit at a time and call a sleep function between
them.

it is simulat to an I2C network.
one data line
one clock line.
when the clock line goes high the value of the data line is read.

example:
(start state)
clock line low
data line unknown.

call putpin(dataline, bxoutputhigh)
call putpin(clockline,bxoutputhigh)
'the data is now read by the reciver.
call putpin(clockline,bxoutputlow)

'cycle for one bit is done.

normaly the MSB is sent first.
--- wrote:
> I'm trying to talk to an AWC PAK7 pulse coprocessor (http://www.al-
> williams.com/awce/pak7.htm) and it calls for the use of shiftin and
> shiftout to do the talking ... but the clock speed is limited to no
> more than 100kHz. Default for shifting data with a Stamp2 is 16kHz.
>
> Is there a way to slow the BX-24 shift instructions down (default
> 400kHz) or a quick 'n dirty set of subroutines out there that mimic
> the standard shiftin/out that would accomplish the same goal?
>
> Thanks much,
> Larry Goodhind
> Redmond, WA >
>
>

=====
Tony Brenke
North Tacoma, WA

__________________________________________________






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: slow (16-50kHz) shiftin & shiftout-code - Tony Brenke - Feb 28 5:36:00 2001

I just answered another email with a sub I slaped togather.
here it is.

public sub ShiftOutSlow(byval value as byte, byval NumBits as byte,
byval SleepVal as integer)
dim loopcounter as byte
for loopcounter = Numbits to 0 step -1
if (getbit(value,loopcounter)=1) then
call putpin(dataline,bxoutputhigh)'1
call putpin(clockline,bxoutputhigh)
call sleep(sleepval)
call putpin(clockline,bxoutputlow)
else
call putpin(dataline,bxoutputlow)'0
call putpin(clockline,bxoutputhigh)
call sleep(sleepval)
call putpin(clockline,bxoutputlow)
endif
end sub --- Tony Brenke <> wrote:
> you can make your own.
> or
> you can shift out one bit at a time and call a sleep function between
> them.
>
> it is simulat to an I2C network.
> one data line
> one clock line.
> when the clock line goes high the value of the data line is read.
>
> example:
> (start state)
> clock line low
> data line unknown.
>
> call putpin(dataline, bxoutputhigh)
> call putpin(clockline,bxoutputhigh)
> 'the data is now read by the reciver.
> call putpin(clockline,bxoutputlow)
>
> 'cycle for one bit is done.
>
> normaly the MSB is sent first. >
> --- wrote:
> > I'm trying to talk to an AWC PAK7 pulse coprocessor (http://www.al-
> > williams.com/awce/pak7.htm) and it calls for the use of shiftin and
>
> > shiftout to do the talking ... but the clock speed is limited to no
>
> > more than 100kHz. Default for shifting data with a Stamp2 is 16kHz.
> >
> > Is there a way to slow the BX-24 shift instructions down (default
> > 400kHz) or a quick 'n dirty set of subroutines out there that mimic
>
> > the standard shiftin/out that would accomplish the same goal?
> >
> > Thanks much,
> > Larry Goodhind
> > Redmond, WA
> >
> >
> >
> >
> >
> >
> > =====
> Tony Brenke
> North Tacoma, WA
>
> __________________________________________________ >
>

=====
Tony Brenke
North Tacoma, WA

__________________________________________________





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )