Microcontroller › PIC › About dsPIC33 programming in C
- This topic has 6 replies, 3 voices, and was last updated 12 years, 1 month ago by AJISH ALFRED.
-
AuthorPosts
-
May 22, 2012 at 10:49 am #1812RahulParticipant
Hello all,
Can cany one help me how can I start learning dsPIC programming easily? I am beginner in this field. I have to write a program for wireless transmission.
Thank you
May 22, 2012 at 1:18 pm #7873AmrithParticipantHi Rahul,
Buy an PIC arduino development board, if you are a beginner then start coding for basic applications such as blinking leds through i/o pins.
June 5, 2012 at 2:35 pm #7971RahulParticipantHello everyone,
Can anyone help me how can we implement RF remotecontrol 8 channel receiver interface with PPM.
Thank you
June 8, 2012 at 5:00 pm #7980AJISH ALFREDParticipantHi Rahul,
Do you already have the RF remote control and 8 channel receiver with you ?
There are different types available. Please share the part number or link to its datasheet, so that it would be easy for someone who can could help you.
June 11, 2012 at 8:56 am #7993RahulParticipantHello AJISH ALFRED,
I already bought 8 channel receiver its from Graupner “SMC 16 SCAN 35”. working at 35 Mhz. I am using the microcontroller of PIC33 family.
July 9, 2012 at 4:39 pm #8225RahulParticipanthello all,
I have a code whic i think everything is ok but while compiling it gives many errors…can any one help me to debug it. I have this for measurinf pulse width of PPM signal received by 8 channel receiver.
# define PPM_Number_of_Channels 8int failSafePulses = 0;int PPM_IN[input+1]; // Pulse Width of input signalunsigned int rise[input+1] ; //rising edge clockunsigned char ch; //PPM channel counterunsigned int fall; // Record PPM fall timeBoolean framok; // Are all measurement ok#define PPM_FAILSAFE_INPUT_MIN 1500#define PPM_ADJUST 1000void capture_int(void){T2CON = 0b1000000000000000 ; // turn on timer 2 with no prescalerTRISD = 0b1111111111111111 ; // make the d port input, to enable IC1 and IC2TRISFbits.TRISF6 = 1 ; // make F6 an input to enable the 3rd switchIC1CON = IC2CON = IC7CON = IC8CON = 0b0010000010000001 ; //IMC<2:0> = 001 (Capture every rising and falling edge)IPC0bits.IC1IP = IPC1bits.IC2IP = IPC4bits.IC7IP = IPC4bits.IC8IP = 6 ; // priority 6IFS0bits.IC1IF = IFS0bits.IC2IF = IFS1bits.IC7IF = IFS1bits.IC8IF = 0 ; // clear the interruptIEC1bits.IC7IE = 1 ; // turn on interrupt for input 1return ;}void __attribute__((__interrupt__,__no_auto_psv__)) _IC7Interrupt(void){unsigned int time ;unsigned int pulse;IFS1bits.IC7IF = 0 ; // clear the interruptwhile ( IC7CONbits.ICBNE ){time = IC7BUF ;}#if ( NORADIO == 0 )if (!PORTBbits.RB4) //first change!{fall = time ;}else{pulse = ((time – fall ) >> 1 )+ PPM_ADJUST ;if (pulse > 10000) //sync pulse{ch = 1;frameOK = true;}else{PPM_IN[ch] = pulse;if (ch < PPM_NUMBER_OF_CHANNELS + 1 )ch++; //scan next channelelse{if(frameOK == false){failSafePulses = 0 ;flags._.radio_on = 0 ;LED_GREEN = LED_OFF ;}if( (PPM_IN[FAILSAFE_INPUT_CHANNEL] > FAILSAFE_INPUT_MIN) && (PPM_IN[FAILSAFE_INPUT_CHANNEL] < FAILSAFE_INPUT_MAX ) )failSafePulses++ ;ch = 1;frameOK = true;}if ( (pulse < PPM_FAILSAFE_INPUT_MIN ) ){frameOK = false;}}}#endif}thank youRahulJuly 27, 2012 at 2:19 pm #8343AJISH ALFREDParticipantHi Rahul,
Please tell us more about your project.
Also make the following things clear,
Which is the controller you are using?
What exactly should the above code meant to do?
Which all errors are you getting?
The IDE you are using?
Also kindly post the code again, this time properly commented, line by line, block by block.
Also give us an idea about your hardware connections.
-
AuthorPosts
- You must be logged in to reply to this topic.