Mr.Henrik Olsson : THANK YOU ! With some minors modification (reversing order ; changes in KeyPad2.pbp ; adding input/output timming), the code work PERFECT !!!
Mr.Henrik Olsson : THANK YOU ! With some minors modification (reversing order ; changes in KeyPad2.pbp ; adding input/output timming), the code work PERFECT !!!
I have all information about code for JVC remote : http://www.avforums.com/forums/car-e...l#post16560076
The code is ... SO BIG....
This is how commands look :
where the <C>s should be replaced by:Code:11111111000000000000000011111111 01110111011101110101010111<C>0111 11111111111111111111111111111111 01110111011101110101010111<C>0111 11111111111111111111111111111111 01110111011101110101010111<C>0111 11111111111111111111111111111111
How #*&^%$#@"_)_ can write this in PBP ? I can figure out...Any help will be wellcome ! Thanks !Code:0x04 Vol+ 01010111101010101 0x05 Vol- 01111010111101010101 0x08 Source 01010101111010101 0x0D Sound 01111010111101111010101 0x0E Mute 01011110111101111010101 0x12 Skip fwd or Right 01011110101011110101 0x13 Skip back or left 01111011110101011110101 0x14 Skip fwd hold or Up 01010111101011110101 0x15 Skip back hold or down 01111010111101011110101
Last edited by fratello; - 9th March 2012 at 08:31.
In front of each <Command> it's this : 00000000000000001111111101110111011101110101010111 <C>
How can be writting, more "elegant" this :
Code:timp con 536 ... portb.x = 0 pauseus 8584 ; 16 x 536,5 us portb.x = 0 pauseus 4292 ; 8 x 536,5 us portb.x = 0 pauseus timp portb.x = 0 pauseus 1610 ; 3 x 536,5 us portb.x = 0 pauseus timp portb.x = 0 pauseus 1610 portb.x = 0 pauseus timp portb.x = 0 pauseus 1610 portb.x = 0 pauseus timp portb.x = 0 pauseus 1610 portb.x = 0 pauseus timp portb.x = 0 pauseus timp portb.x = 0 pauseus timp portb.x = 0 pauseus timp portb.x = 0 pauseus timp portb.x = 0 pauseus timp portb.x = 0 pauseus timp portb.x = 0 pauseus 1610
Hi,
As last time this is completely untested. This builds and sends the command in steps which means that there will be some delay between the "preamble", "command" and "postamble". I don't know how tight the timing has to be so doing it this way may or may not work.Again, not tested so take it for what it is.Code:'**************************************************************** '* Name : Fratello_JVC.pbp * '* Author : Henrik Olsson * '* Notice : * '* : * '* Date : 2012-03-12 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** i VAR BYTE j VAR BYTE OutBuffer VAR BYTE[8] BitsToSend VAR BYTE Main: For j = 0 to 10 GOSUB VolUp Pause 1000 NEXT FOR j = 0 to 10 GOSUB VolDn PAUSE 1000 NEXT GOTO Main SendPreamble: ' 00000000 00000000 11111111 01110111 01110111 01010101 11 ' Each individual byte reversed: OutBuffer[0] = %00000000 OutBuffer[1] = %00000000 OutBuffer[2] = %11111111 OutBuffer[3] = %11101110 OutBuffer[4] = %11101110 OutBuffer[5] = %10101010 OutBuffer[6] = %00000011 BitsToSend = 50 GOSUB SendBits RETURN '----------------------------------------------------------------------- SendPostAmble: ' 01111111 11111111 11111111 11111111 11110111 01110111 01110101 010111 OutBuffer[0] = %11111110 OutBuffer[1] = %11111111 OutBuffer[2] = %11111111 OutBuffer[3] = %11111111 OutBuffer[4] = %11101111 OutBuffer[5] = %11101110 OutBuffer[6] = %10101110 OutBuffer[7] = %00111010 BitsToSend = 54 GOSUB SendBits RETURN '----------------------------------------------------------------------- '----------------------------------------------------------------------- VolUp: GOSUB SendPreAmble ' 01010111 10101010 1 ' Each individual byte reversed OutBuffer[0] = %11101010 OutBuffer[1] = %01010101 OutBuffer[2] = %00000001 BitsToSend = 17 GOSUB SendBits GOSUB SendPostAmble RETURN '----------------------------------------------------------------------- '----------------------------------------------------------------------- VolDn: GOSUB SendPreAmble ' 01111010 11110101 0101 ' Each individual byte reversed OutBuffer[0] = %01011110 OutBuffer[1] = %10101111 OutBuffer[2] = %00001010 BitsToSend = 20 GOSUB SendBits GOSUB SendPostAmble RETURN '----------------------------------------------------------------------- '----------------------------------------------------------------------- SendBits: BitsToSend = BitsToSend - 1 For i = 0 to BitsToSend PortB.0 = OutBuffer.0[i] PauseUs 536 NEXT RETURN '-----------------------------------------------------------------------
/Henrik.
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.
Hi! I am from Turkey. Taken in the forum I read that you are running on the remote control for Alpine.What did you use microcontrollers. I worked very hard, but did not succeed. Can you give pbp code for alpine? My adress is [email protected] Thanks.
Bookmarks