Discussion forum for the BasicX family of microcontroller chips.
|
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 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 __________________________________________________ |
|
|
|
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 __________________________________________________ |