Larry 676 does not have hs_osc so it would not compile thanks for trying
BUT:
I'm up and running (cross fingers)
remember I said something about adjusting to midpoint of the bit
well I did 'Command_byte:you had dropped it from104 to 80 to adjust timing
I dropped to 60 (about half) and bingo it's running (started@ 70 and it ran)
I think 80 is right on the edge that's why sometime it work and then the next
it did'n
and this is with my standard Lanc control board using
1 pin to read / write no pull up or down 60 ohm resistor in Lanc line
this basic program just start recording 10 sec. movie then stop wait
5 sec. and start over. If it will run one command it should run ALL
it's been running for about 2 hr. with out missing abeat
Now the bad news the next few days are full full full . not sure it I will have time to eat much less to play I mean work on this
I would be interested to know how it looks on the scope
grounded
Code:'**************************************************************** '* Name : pbplanc_T_1833.BAS '* Author : GROUNDED '* Notice : Copyright (c) 2009 '* : All Rights Reserved '* Date : 9/25/2009 '* Version : 1.0 '* Notes : testing pbp lanc basic just record and stop ' '**************************************************************** pic16F676 @ __config _XT_OSC & _WDT_ON & _MCLRE_OFF & _CP_OFF PAUSE 5000 CMCON = 7 VRCON = 0 TRISA = %00001000 TRISC = %00000000 ANSEL = %00000000 OPTION_REG=%01000000 WPUA = %00000000 HIGH PORTC.0 :PAUSE 3000 :LOW PORTC.0 'POWER UP LED PAUSE 1000 command_bit var bit syncbit var byte syncbyte var word counter var byte value var byte Bits var byte Goto start Sync_byte: syncbyte = 0 while syncbyte < 700 pulsin PORTC.4, 1, syncbyte wend Return Sync_bit: syncbit = 0 while syncbit < 9 pulsin PORTC.4, 0, syncbit wend Return Command_byte: '00011000 SEND 18 gosub sync_byte pauseus 60 'CHANGED FROM 80 TO 60 (LITTLE OVER HALF OF 104) TIMING ADJUST input PORTC.4 pauseus 312 '000 low PORTC.4 pauseus 208 '11 input PORTC.4 pauseus 312 '000 input PORTC.4 'Stop bits set high Return START: Record_on: '11001100 SEND 33 gosub Command_byte gosub Sync_bit low PORTC.4 pauseus 208 '11 input PORTC.4 pauseus 208 '00 low PORTC.4 pauseus 208 '11 input PORTC.4 pauseus 208 '00 input PORTC.4 'Stop bits set high counter = counter +1 if counter = 4 then GOTO MT goto Record_on MT: COUNTER =0 PAUSE 10000 '10 SEC. MOVIE Record_off: '11001100 SEND 33 gosub Command_byte gosub Sync_bit low PORTC.4 pauseus 208 '11 input PORTC.4 pauseus 208 '00 low PORTC.4 pauseus 208 '11 input PORTC.4 pauseus 208 '00 input PORTC.4 'Stop bits set high counter = counter +1 if counter =4 then GOTO OVER goto Record_OFF OVER: PAUSE 5000 GOTO START




Bookmarks