BasicMicro - Forums

www.basicmicro.com
It is currently Sun May 20, 2012 11:38 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Shiftout, 1 Variable => O.K 2 Variables => Problem
PostPosted: Tue Oct 30, 2007 10:00 pm 
Offline
Citizen

Joined: Wed Mar 13, 2002 11:00 am
Posts: 32
I switched from BS2p40 to BasicAtom 40
And try to convert and extend my Program
When I use :
SHIFTOUT DataPin,ClockPin,msbpre,[schalten216]
Only with one variable “schalten2” It works fin.
But when I use:
SHIFTOUT DataPin,ClockPin,msbpre,[schalten116,schalten216]
two variables my connected UCN 5833 (Allegro 32-Bit serial-Input Driver)
switches always on, the Out1. I am not switching the bit 0..
I used the same shiftout command on the BasicStamp40
and as far as I understand the manual, it works similar on the Atom40,
On the debug the variable has the correct value on both variables (schalten1 and schalten2)
but the UCN 5833 switches on the out1.
It looks like as if the Atom gifs out one more data and clock pulse then the Stamp.

Or did I misunderstand something ??

Heinz
PS
Here my code with the two variables (schalten1 and schalten2)

schalten1 VAR Word...............' Bit 0-15 for shift
schalten2 VAR Word............... 'Bit 16-32 for shift

schalten2 = 0
schalten1 = 0
gosub UCN

start:
.....schalten2.bit13 = 1
.....schalten1 = %1111111111111111
..gosub UCN
.....Pause 500
.....schalten1 = 0
.....schalten2 = 0
..gosub UCN
.....Pause 500
.........goto start

...UCN:
..... SHIFTOUT DataPin,ClockPin,msbpre,[schalten116,schalten216] ..........' Daten zum UCN5830
.....PULSOUT strobePin,1...........................................................................' Transfer to outputs.
..........RETURN


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO