Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
Posted: Sun Jun 20, 2010 9:51 am Post subject: SHIFTOUT...
If I understand correctly you want to shiftout A on P1.1
I read this on the Online Bascom-8051 help.
Action
Shifts a bit stream in or out a variable.
Syntax
SHIFTIN pin , pclock , var , option [PRE]
SHIFTOUT pin , pclock , var , option
Remarks
pin
The portpin which serves as as input/output.
pclock
The portpin which generates the clock.
var
The variable that is assigned.
option
Option can be :
0 - MSB shifted in/out first when clock goes low
1 - MSB shifted in/out first when clock goes high
2 - LSB shifted in/out first when clock goes low
3 - LSB shifted in/out first when clock goes high
For the SHIFTIN statement you can add 4 to the parameter to use the external clock signal for shifting.
PRE
Add this additional parameter (no comma) to sample the input pin before the clock signal is generated.
It depends on the type of the variable, how many shifts will occur.
When you use a byte, 8 shifts will occur and for an integer, 16 shifts will occur.
Example
Dim a as byte
SHIFTIN P1.0 , P1.1 , a , 0
SHIFTOUT P1.2 , P1.1 , a , 0
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 vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum