WOW! Amazing ! Thank YOU so much !!!
I discover, every time when someone, like YOU, post such a great example of code, how far I am from understanding this great art of programming !!!
I made the tests and post the results. Best regards !
WOW! Amazing ! Thank YOU so much !!!
I discover, every time when someone, like YOU, post such a great example of code, how far I am from understanding this great art of programming !!!
I made the tests and post the results. Best regards !
I made some changes ....
and added this :Code:VolUp: GOSUB SendPreAmble ' 01010111 10101010 1 ' Each individual byte reversed OutBuffer[0] = %11101010 OutBuffer[1] = %01010101 ; modified OutBuffer[2] = %00000001 BitsToSend = 17 GOSUB SendBits GOSUB SendPostAmble OutBuffer[0] = %11101010 OutBuffer[1] = %01010101 ; modified OutBuffer[2] = %00000001 BitsToSend = 17 GOSUB SendBits GOSUB SendPostAmble OutBuffer[0] = %11101010 OutBuffer[1] = %01010101 ; modified OutBuffer[2] = %00000001 BitsToSend = 17 GOSUB SendBits GOSUB SendFinalAmble RETURN
...and in Proteus look fine !Code:SendFinalAmble: ' 01111111 11111111 11111111 11111111 11111111 11111111 11111111 111111 OutBuffer[0] = %11111110 OutBuffer[1] = %11111111 OutBuffer[2] = %11111111 OutBuffer[3] = %11111111 OutBuffer[4] = %11111111 OutBuffer[5] = %11111111 OutBuffer[6] = %11111111 OutBuffer[7] = %11111111 BitsToSend = 54 GOSUB SendBits RETURN
Are you sure you actually have to send the command three times? Personally I have NO knowlage about these things but I would've guessed (if this is captured from a remote for example) that it just kept repeating the command and postamble untill the button was released and then issued the 'FinalAmble'. So perhaps Preamble, Command, FinalAmble is all you actually need? Oh well, like I said, I have no idea really - just guessing, you'll figure it out.
/Henrik.
My informations are from one user of AVFORUMS.COM.
"Every time you send the device and command codes, you should repeat the device and command codes three times, but pause between them for about 20ms." I think it's true...
Still beta-testing...
I wonder...It's one way to obtain EXACTLY 536.5 us ?!?
Depends.... What's you oscillator speed? At 20Mhz an instruction cycles is 200ns so, in theory, doing something likeshould get you pretty close (536.4us). If the timing is that critical then it's probably not going to work the way I wrote it since there will be "gaps" between the preamble, command, postamble etc. You'd need to build the complete message in a larger array and then send it but that gets a bit complicated due to the variation in length of the commands (they won't line up at even byte boundries).Code:PauseUs 536 @ NOP @ NOP
/Henrik.
Thank You for support !
The oscillator is 4 MHz...
Bookmarks