We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I've written an initialization file via the Function Editor (uVision2, version V2.37 ) to generate pulses on P3_2. This is to simulate RC5. I've written -among other things- the following button definition
define button "Send 0x2183","send_p32_info( 0x2183 )"
*** error75, line13: too many items
//ws 1, _rword(&PulseWidth) //ws 1, _rword(&RCapTime) //ws 1, _rword(&RcMessage) //ws 1, PrevEdgeInMiddleOfBit //ws 1, FirstNegEdge ws 1, ReloadTimerTime ws 1, EdgeDetectTime ws 1, NrOfBools ws 1, Rc5Input // VALUE TO SEND SHOULD BE AT LEAST 0x2000: FIRST BIT IS ALWAYS 1!!! define button "Send 0x2183" , "send_p32_info( 0x2183 )" define button "Send Vol Up" , "send_p32_info( 0x3010 )" define button "Send Vol Down" , "send_p32_info( 0x3011 )" define button "Send 0x2AAA" , "send_p32_info( 0x2AAA )" define button "Send 0x2781" , "send_p32_info( 0x2781 )" define button "Send 0x2766" , "send_p32_info( 0x2766 )" define button "Send 0x2677" , "send_p32_info( 0x2677 )" define button "Send 0x3677" , "send_p32_info( 0x3677 )" define button "Send 0x3676" , "send_p32_info( 0x3676 )" define button "Send 0x2888" , "send_p32_info( 0x2888 )" define button "Send 0x3999" , "send_p32_info( 0x3999 )" define button "Send 0x3FFF" , "send_p32_info( 0x3FFF )" define button "Send 0x2000" , "send_p32_info( 0x2000 )" define button " Send all " , "send_all()" define button "Stop sending" , "signal kill send_p32_info" define button "Send 0x20FF" , "send_p32_info( 0x20AA )" signal void send_p32_info( unsigned int val ) { signed char i; //while (1) { for (i = 13; i >= 0; i--) { if (val & (1 << i)) /* Send 1 */ { //printf( "P3.2 high\n" ); P3 |= 0x04; twatch (889); //printf( "P3.2 low\n" ); P3 &= ~0x04; twatch (889); printf( "Send 1, counter is: %i\n", i ); } else /* Send 0 */ { //printf( "P3.2 low\n" ); P3 &= ~0x04; twatch (889); //printf( "P3.2 high\n" ); P3 |= 0x04; twatch (889); printf( "Send 0, counter is: %i\n", i ); } } } P3 |= 0x04; twatch (889); printf( "***************\n" ); printf( "***************\n" ); printf( "* End Sending *\n" ); printf( "***************\n" ); printf( "***************\n" ); } signal void send_all() { signed int i; i = 0x2000; while ( 1 ) { send_p32_info( i ); i++; if ( i == 0x4000 ) { i = 0x2000; } swatch( 1 ); } }