Forum Replies Created

Viewing 15 posts - 106 through 120 (of 228 total)
  • Author
    Posts
  • in reply to: DS1307 RTC with PIC Microcontroller #11519
    Ligo George
    Keymaster

    For understanding those HOUR setting steps, you should read the datasheet of DS1307.

    You can find that all bits of HOUR registers are not used for indicating hour magnitude. It can indicate in 24 or 12 hour mode.

    DS1307 Time Keeper Registers

    in reply to: Retrieving UART data on LCD using PIC16F877A #11512
    Ligo George
    Keymaster

    Sorry I don’t understand your CopyConst2Ram(). You can use the following function for that.

    char* CopyConst2RAM(const char* ctxt)
    {
      static char temp[20];
      char i;
      for(i =0; temp[i] = ctxt[i]; i++);
      return txt;
    }
    
    in reply to: PIC16F877A with DC Gear Motor #11511
    Ligo George
    Keymaster

    You may use voltage dividing resistors and/or 5.1V zener diode to reduce the sensor output voltage down to 5.1V.

    in reply to: Retrieving UART data on LCD using PIC16F877A #11499
    Ligo George
    Keymaster

    I can’t find any problems in the above code.

    What about the entire code ? Is it too lengthy ?

    Make sure that free RAM is above 30% otherwise it may cause such issues.

    in reply to: PIC16F877A with DC Gear Motor #11498
    Ligo George
    Keymaster

    Sorry, I don’t have any circuit or tutorials for interfacing inductive proximity sensors. Which sensor you are using ?

    in reply to: PIC16F877A with DC Gear Motor #11492
    Ligo George
    Keymaster

    I think the problem is with type of switch you are using. You should use a micro switch, which will return to OFF state after the press. If you want to use ON – OFF switch you can add while(PORTD.F0 == 0); at end of if loop.

    in reply to: PIC16F877A with DC Gear Motor #11488
    Ligo George
    Keymaster

    Sorry, I don’t understand what you are telling. The above program will check the sensor input only when you press the push button switch. It will not give any output without pressing of switch.

    in reply to: PIC16F877A with DC Gear Motor #11486
    Ligo George
    Keymaster

    As long as RD0 = 0 and RD1 = 1 the sequence will repeat continuously as per the above program.

    in reply to: PIC16F877A with DC Gear Motor #11484
    Ligo George
    Keymaster

    Are you sure that you are using push switch ?

    If you are using push switch, the sequence will not repeat without pressing of switch.

    Most of the microcontroller programs requires infinite loop as it needs to continuously read sensor status, switch status etc.

    in reply to: Retrieving UART data on LCD using PIC16F877A #11479
    Ligo George
    Keymaster

    Please post the code or AT command used to send this sms.

    in reply to: 18F4550 with 74LS138 #11471
    Ligo George
    Keymaster

    You may use it like matrix keypad. Use 6 pins of PIC as inputs such that you can connect 24 x 6 = 144 switches.

    in reply to: PIC16F877A with DC Gear Motor #11469
    Ligo George
    Keymaster

    It seems like the the program is correct as per the logic explained by you. You can use L298N, if you need more current.

    in reply to: PIC16F877A with DC Gear Motor #11466
    Ligo George
    Keymaster

    Firstly, above code is for MikroC Pro compiler. You can reduce the voltage of Proximity Sensor using Voltage dividing resistors and/or zener diode.

    Continuous pressing of switch is not required, it depends on how you program (how many times you read switch) etc.

    in reply to: PIC16F877A with DC Gear Motor #11457
    Ligo George
    Keymaster

    Just read the above tutorials carefully, you can do it yourself. You can connect two switches to any of the IO pins of PIC Microcontroller. You can make those pins Input by writing to TRIS register. Similarly you can connect L293D inputs to 2 outputs of MCU and make those pins Output by writing to TRIS register.

    in reply to: Microsecond variable Delay in MikroC #11456
    Ligo George
    Keymaster

    Hi, the following variable microsecond delay functions will work with enough accuracy if you use clock 20MHz or more.
    For PIC 16F

    void Vdelay_us(unsigned time_us)
    {
      unsigned ncyc;
      ncyc = Clock_MHz()>>2;
      ncyc *= time_us>>4;
      while (ncyc--) 
      {
        asm nop;
        asm nop;
      }
    }
    

    For PIC 18F

    void Vdelay_us(unsigned time_us)
    {
      unsigned ncyc;
      ncyc = Clock_MHz()>>2;
      ncyc *= time_us>>4;
      while (ncyc--) 
      {
        asm nop;
        asm nop;
        asm nop;
      }
    }
    
Viewing 15 posts - 106 through 120 (of 228 total)
>