EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / About dsPIC33 programming in C

About dsPIC33 programming in C

|

Microcontroller › PIC › About dsPIC33 programming in C

  • This topic has 6 replies, 3 voices, and was last updated 12 years, 10 months ago by AJISH ALFRED.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • May 22, 2012 at 10:49 am #1812
    Rahul
    Participant

    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 #7873
    Amrith
    Participant

    Hi 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 #7971
    Rahul
    Participant

    Hello 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 #7980
    AJISH ALFRED
    Participant

     

    Hi 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 #7993
    Rahul
    Participant

    Hello 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 #8225
    Rahul
    Participant

    hello 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 8
    int failSafePulses = 0;
    int PPM_IN[input+1];                // Pulse Width of input signal
    unsigned int rise[input+1] ; //rising edge clock
    unsigned char ch; //PPM channel counter
    unsigned int fall; // Record PPM fall time
    Boolean framok; // Are all measurement ok
     
    #define PPM_FAILSAFE_INPUT_MIN 1500
    #define PPM_ADJUST 1000
     
    void capture_int(void)
     
    {
    T2CON = 0b1000000000000000  ; // turn on timer 2 with no prescaler
    TRISD = 0b1111111111111111 ; // make the d port input, to enable IC1 and IC2
    TRISFbits.TRISF6 = 1 ; // make F6 an input to enable the 3rd switch
    IC1CON = IC2CON = IC7CON = IC8CON = 0b0010000010000001 ; //IMC<2:0> = 001 (Capture every rising and falling edge)
     
    IPC0bits.IC1IP = IPC1bits.IC2IP = IPC4bits.IC7IP = IPC4bits.IC8IP = 6 ; // priority 6
    IFS0bits.IC1IF = IFS0bits.IC2IF = IFS1bits.IC7IF = IFS1bits.IC8IF = 0 ; // clear the interrupt
     
    IEC1bits.IC7IE = 1 ; // turn on interrupt for input 1
     
    return ;
    }
     
    void __attribute__((__interrupt__,__no_auto_psv__)) _IC7Interrupt(void)
    {
    unsigned int time ;
    unsigned int pulse;
     
    IFS1bits.IC7IF = 0 ; // clear the interrupt
    while ( 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 channel
    else 
    {
    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 you
    Rahul
    July 27, 2012 at 2:19 pm #8343
    AJISH ALFRED
    Participant

    Hi 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.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Trail camera May 20, 2025
  • how to work on pcbs that are thick May 20, 2025
  • can a AT89C51 be used as a rom? May 20, 2025
  • Telegram Based Alarm - Sensor cable protection May 20, 2025
  • using a RTC in SF basic May 19, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise