ME Labs, Inc. 719-520-5323 |
ME Labs, Inc. | 1-719-520-5323 | Example Program - SHIFT.pbpPICBASIC PRO Code to demonstrate the use of SHIFTIN / SHIFTOUT commands.' Name : SHIFT.pbp ' Compiler : PICBASIC PRO Compiler 2.6 ' Assembler : PM or MPASM ' Target PIC : 12F, 16F, 18F ' Hardware : Non specific ' Oscillator : 4MHz internal or external ' Keywords : SHIFTIN, SHIFTOUT ' Description : PICBASIC PRO Code to demonstrate the use of ' SHIFTIN / SHIFTOUT commands. ' Include "modedefs.bas" ' Include shift modes D1PIN Var PORTA.0 ' Shift data pin 1 C1PIN Var PORTA.1 ' Shift clock pin 1 D2PIN Var PORTB.0 ' Shift data pin 2 C2PIN Var PORTB.1 ' Shift clock pin 2 bvar Var byte wvar Var word mainloop: ' Shift in 10 bits of data Shiftin D1PIN, C1PIN, MSBPRE, [wvar\10] bvar = wvar ' Shift out 8 bits of data onto other pins Shiftout D2PIN, C2PIN, MSBFIRST,[bvar] Pause 500 Goto mainloop End Download the program file. |
Copyright 2019 ME Labs, Inc. PO Box 8250 Asheville NC 28814 (719) 520-5323 (719) 520-1867 fax email: support@melabs.com |
|