Forum Replies Created

Viewing 15 posts - 121 through 135 (of 228 total)
  • Author
    Posts
  • in reply to: PIC16F877A with DC Gear Motor #11452
    Ligo George
    Keymaster

    Hi,

    About PULL UP or PULL DOWN resistors used along with Switches.

    Switch is connected to an input pin of Microcontroller. A pin is in input state means that it is in HIGH IMPEDANCE state. So if you don’t connect any PULL UP or PULL DOWN resistors that pin will remains FLOATING when the switch is in OFF state. A floating pin may catch noises and reading such a pin will result in unexpected results. Its value usually varies erratically varies.

    Programming Language

    It is C.

    in reply to: PIC16F877A Stack problem #11342
    Ligo George
    Keymaster

    Please post the code here.. otherwise it is not possible to find the problem.

    Basically it will be a problem with function calling…

    in reply to: Microcontroller pin in High Impedance State #11324
    Ligo George
    Keymaster

    You can make a pin of Microcontroller in High Impedance State by making it as an Input Pin. All input pins will be in High Impedance State.

    in reply to: PIC Microcontroller Pin in High Impedance State #11323
    Ligo George
    Keymaster

    You can easily make an IO pin of PIC Microcontroller in High Impedance by making it an Input Pin. Just set the TRIS bit corresponding to the pin, it will make that pin High Impedance Input.

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

    It is very difficult to obtain accurate variable microsecond delay function. Make the oscillator clock frequency as high as possible and you can use Delay_Cyc() in MikroC which creates delay based in clock cycle. You may also try creating your own delay function like the following (following code is not calibrated for microsecond).

    void Delay(unsigned int i)
    {
        for(;i>0;i--)
        {
        }
    }
    in reply to: Microsecond variable Delay in MikroC #11240
    Ligo George
    Keymaster

    Try like this :

    switch(angle)
    {
        case 0 : 
                PORTX.FX = 1;
                Delay_us(...);
                PORTX.FX = 0;
                Delay_us(...);
                break;
        case 1:
                PORTX.FX = 1;
                Delay_us(...);
                PORTX.FX = 0;
                Delay_us(...);
                break;
    }
    
    in reply to: Microsecond variable Delay in MikroC #11234
    Ligo George
    Keymaster

    Micro second variable delays will be very difficult to create and it will not accurate too as each instructions will take a few microsecond to execute. That is why MikroC doesn’t implement this function.

    Ligo George
    Keymaster

    MCP6050 is a 3.3V device while 16F877A is 5V.

    So the best method is to use a Bi-directional logic level converter to connect both devices via I2C.

    But I hope that it will work fine with 3.3V PULL UP resistors between them for testing / hoppy project purposes.

    in reply to: EGG INCUBATOR #11150
    Ligo George
    Keymaster

    What is the problem with your project ?

    in reply to: MikroC OneWire Example Help #11134
    Ligo George
    Keymaster

    It is to convert each extracted digit to corresponding character.
    ‘0’ => 0 + 48
    ‘1’ => 1 + 48
    ‘2’ => 2 + 48
    etc.

    Please refer ASCII Table for more reference.

    in reply to: RPM sensing using hall effect sensor #11112
    Ligo George
    Keymaster

    Using Interrupt with PIC Microcontroller – MikroC

    Please read the datasheet of PIC 16F877A microcontroller… there you can find the procedure to use timer / counter module.

    in reply to: PWM using PIC18F #11106
    Ligo George
    Keymaster

    You can program like this :

    .............
    .............
    TRISD.F0 = 1;
    TRISD.F1 = 1;
    .............
    .............
    while(1)
    {
      while(PORTD.F0 == 0)
      {
         LATB.F0 = 1; // Use LAT register to write output in 18F
         Delay_ms(1000);
         LATB.F0 = 0;
         Delay_ms(2000);
      }
      
      while(PORTD.F1 == 0)
      {
        LATB.F0 = 1;
        Delay_ms(2500);
        LATB.F0 = 0;
        Delay_ms(5000);
      }
    }
    
    in reply to: Retrieving UART data on LCD using PIC16F877A #11095
    Ligo George
    Keymaster

    You should check whether the data is ready or not… every time before calling UART_Read().

    in reply to: RPM sensing using hall effect sensor #11094
    Ligo George
    Keymaster

    Hello, you can use the INTERRUPT or COUNTER module of PIC Microcontroller for that.

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

    Not, ECHO mode..

    You should turn on NEW Message Indications by using correct settings

    • AT+CMGF=1 – Text Mode
    • AT+CNMI=2,0,0,0,0
Viewing 15 posts - 121 through 135 (of 228 total)
>