![]() |
| | LinkBack | Herramientas | Buscar en este tema |
| |||
| | |||
| hola he ensamblado el circuito con pic de Solo los usuarios registrados pueden ver los links. ¡Registrate ahora, es gratis!. el problema es que el el pic no hace lo que deveria creo!!! de programacion c y assembler nada se y solo programe el pic con el .hex incluido. el programador sumistro las fuentes y si alguien podria probar el circuito y mirar si funciona o revisar el codigo fuente para ver si hay algun problema con el! mi programador funciona bien uso el winpic no da errores, ademas ya programe otro pic igual para este otro circuito Solo los usuarios registrados pueden ver los links. ¡Registrate ahora, es gratis! y funciono correctamente! de antemano gracias por cualquier ayuda |
| |||
| | |||
| logre que funcionara con un control de tv philips (rc5 creo) ahora lo que necesito hacer es remover el manchester decoding del projecto para asi poder utilizar cualquier tipo de control remoto!!! el codigo fuente esta disponible pero no teno idea de c alguien podria ayudarme! gracias |
| |||
| | |||
| hola el codigo fuente esta aqui Solo los usuarios registrados pueden ver los links. ¡Registrate ahora, es gratis! lo que se quiere modificar es que solo lee rc5 i la idea es que lea cualqueir remoto en la pagina del proyecto dice que es posible y que solo hay que eliminar el manchester decoding y poner uno general..... alguna idea? |
| |||
| | |||
| segun he leido lo que se deve modificar es la parte del processio y el interruphandler en el main.c ideas please /************************************************** ****************** * Function: void ProcessIO(void) * * PreCondition: None * * Input: None * * Output: None * * Side Effects: None * * Overview: This function is a place holder for other user * routines. It is a mixture of both USB and * non-USB tasks. * * Note: None ************************************************** *****************/ void ProcessIO(void) { BYTE numBytesRead, numBytesWrite=0,i; static unsigned char rc5x,addr,cmd,toggle; //Blink the LEDs according to the USB device status BlinkUSBStatus(); if(irState==PROCESS){ //0 second start bit rc5x=sample[0]; //1 toggle bit toggle=sample[1]; addr=0; for(i=2;i<7;i++){ //56 78 910 1112 1314 addr<<=1; addr+=sample[i]; } cmd=rc5x;//make rc5x bit 6 //cmd=0; for(i=7;i<13;i++){ //1516 1718 1920 2122 2324 2526 cmd<<=1; cmd+=sample[i]; } irState=SEND; } // User Application USB tasks if((USBDeviceState < CONFIGURED_STATE)||(USBSuspendControl==1)) return; if(mUSBUSARTIsTxTrfReady()){ numBytesWrite=0; if(irState==SEND){ BYTE i; USB_Out_Buffer[numBytesWrite]=addr; numBytesWrite++; USB_Out_Buffer[numBytesWrite]=cmd; numBytesWrite++; for(i=0;i<4;i++){//four buffer bytes for IRMAN/RC5 combo... USB_Out_Buffer[numBytesWrite]=0x00; numBytesWrite++; } irState=SENDING; }else if(irState==SENDING){ irState=IDLE;//wait for more RC commands.... } numBytesRead = getsUSBUSART(USB_In_Buffer,64); //a=getcUSART(); if(numBytesRead != 0){ BYTE i; for(i=0;i<numBytesRead;i++){ switch(USB_In_Buffer[i]){ case 'I'://reset the system, load defaults from eeprom break; case 'R'://got R, send "OK" for IRman protocol //USB USB_Out_Buffer[numBytesWrite]='O'; numBytesWrite++; USB_Out_Buffer[numBytesWrite]='K'; numBytesWrite++; //USART //while(!mTxRdyUSART());//wait for tx //putcUSART('O'); //while(!mTxRdyUSART());//wait for tx //putcUSART('K'); break; case 'C'://rc5 mode //enforce manchester encoding of all 13bits/26periods //take exactly 26 samples. //terminal rc5 decoding protocol //case 0x00-0x29://take 0-x bit samples case 'L'://go silent //set prescaler, post scaler, PR2? case 'S'://save settings to eeprom break; } } } putUSBUSART(USB_Out_Buffer,numBytesWrite); } CDCTxService(); } //end ProcessIO /************************************************** **************************** * Function: void InterruptVectorHigh(void) * * * Note: When the PWM timer interrupt fires the PIC checks here for directions * * ************************************************** ***************************/ //---------------------------------------------------------------------------- // High priority interrupt vector #pragma code InterruptVectorHigh = 0x08 void InterruptVectorHigh (void) { _asm goto InterruptHandlerHigh //jump to interrupt routine _endasm } /************************************************** **************************** * Function: void InterruptHandlerHigh () * * * Note: When the timer interrupts this function is executed: * 1)increment the master SoftPWM counter (SoftPWM.tick) * 2)compare each color's value (SoftPWM.R/G/B) with the counter * 3)turn off colors if SoftPWM.R/G/B=SoftPWM.tick * * ************************************************** ***************************/ //---------------------------------------------------------------------------- // High priority interrupt routine #pragma code #pragma interrupt InterruptHandlerHigh void InterruptHandlerHigh () { static unsigned char a,pr0=0,pr1=0; if(INTCONbits.RBIF == 1){ //if RB Port Change Interrupt a=PORTBbits.RB4;//must read PORTB to clear RBIF.... switch(irState){ case IDLE: if(a==0){//only if a start bit T2CON=PRE_x4+POST_x6; PR2=221; PIR1bits.TMR2IF=0;//clear the interrupt flag PIE1bits.TMR2IE=1; //able interrupts... T2CONbits.TMR2ON=1; irState=HALF_PERIOD; } break; } INTCONbits.RBIF = 0; //Reset the RB Port Change Interrupt Flag bit }else if(PIE1bits.TMR2IE==1 && PIR1bits.TMR2IF==1){ switch(irState){ case HALF_PERIOD: PIE1bits.TMR2IE=1; T2CONbits.TMR2ON=0; //full bit values T2CON=PRE_x4+POST_x12; //PR2=221; PIR1bits.TMR2IF=0;//clear the interrupt flag PIE1bits.TMR2IE=1; //able interrupts... T2CONbits.TMR2ON=1; sampleCount=0; irState=BIT_PERIOD_0; break; case BIT_PERIOD_0: pr0=PORTBbits.RB4; irState=BIT_PERIOD_1; break; case BIT_PERIOD_1: pr1=PORTBbits.RB4; if(pr0==1 && pr1==0){ sample[sampleCount]=1; }else if (pr0==0 && pr1==1){ sample[sampleCount]=0; }else{ //error irState=IDLE; T2CONbits.TMR2ON=0; break; } sampleCount++; irState=BIT_PERIOD_0; if(sampleCount==13){//done sampling irState=PROCESS; T2CONbits.TMR2ON=0; } break; } PIR1bits.TMR2IF=0;//clear the interrupt flag } } |
![]() |
Estas en ElForro.com
ayuda con usb ir pic de hack a day
| Herramientas | Buscar en este tema |
| |
Este tema está relacionado con otros ya publicados en el sitio. Podés visitarlos ahora! | ||||
| Tema | Iniciado por | Foro | Respuestas | Último mensaje |
| Hack para ver en la oscuridad Cs mod zombie (night vision) | leamm89 | Juegos de PC | 7 | 14 de diciembre de 2008 19:34 |
| Super Megapost De Bux.to Con Tutorial Y Hack Para Conseguir Referidos! | facubart | Dinero en Internet | 11 | 23 de noviembre de 2008 10:35 |
| Hack AWSureys Si ya lereron | agustin_racing77 | Dinero en Internet | 1 | 09 de noviembre de 2008 16:27 |
| pagina de descarga de . hack//roots (serie completa) | BigBossJuanchoX | Comics, Manga y Animé | 0 | 08 de diciembre de 2007 21:27 |






