Search Results - mplab

Home Forums Search Search Results for 'mplab'

Viewing 15 results - 16 through 30 (of 31 total)
  • Author
    Search Results
  • #13199
    Ligo George
    Keymaster

    You may use the following links as a reference.

    But you can’t use UART or I2C with 16F84A as there is no hardware module in it. You can try UART with MikroC Soft UART libraries.

    Sorry, currently we don’t have any reference for assembly language.

    Rafat A Gammoh
    Participant

    How can I connect these LEDs and switches to PIC 16F84A ? I need to have PIC to PIC communication and the program has to be in assembly using MPLAB.

    #13098
    [email protected]
    Participant

    I just purchased your PICKit3 from ebay. Received it yesterday. Wonder if you can help me with a technical problem.
    I am familiar with the ICD3 but never used PICKit3.
    I am using the Pickit 3 with MPLAB IPE to load a hex file. The chip is a 16F877A. Hex is loaded successfully in the software. Power is selected from Pickit 3 device. I get this error.
    The target circuit may require more power than the debug tool can provide. An external power supply might be necessary.
    This error occurs on both MPLAB X IDE and MPLAB IPE.
    I understand that the current limit on the Pickit 3 is 30mA. I am only using the programmer to hold the chip. Am I doing something wrong? Or the device cannot power a 16F877A?

    #13096
    Ligo George
    Keymaster

    Dear Dona,

    Kindly open a new topic for asking your doubts.

    You can see our complete UART code in the following article.

    Using UART of PIC Microcontroller – MPLAB XC8

    vijay verma
    Participant

    Dear folks,

    I ‘m working on overvoltage undervoltage protection device project, in this project PIC 16F877a microcontroller is used, but problem is that  i’m not familer with PIC micrcomtroller so that i faced too much trouble, for that project i ‘m using “Hitech C compiler” i have little bit knowledge about PIC micrcontroller but i’m quiet good in AVR microcontroller(atmega16), so can you please provide me code for this project.

    I’m also attach code which is is found to be error on MPLAB softwaree along with the “CIRCUIT DIAGRAM”.so  please reply me, i ‘m waiting for your responce .

    Thanks & regards

    #12550
    Ligo George
    Keymaster

    Sorry, we don’t have any MPLAB codes. You may convert MikroC codes to MPLAB using our PWM Library.

    #12352
    Ligo George
    Keymaster

    Hi,
    Sorry for the delay in reply. We were about to publish an article regarding this. So now, try the following link.

    #12301
    adam1232
    Participant

    Hi everyone,

    I have a task to write a code that would drive the DC motor by rotating the potentiometer between (0-300RPM) using 0-5Volts. (could be in one direction)

    The code has to be written in  a MPLAB v8.70 software using Hi-Tech compiler and ICD3 in-circuit debugger.

    The board and the microprocessor is PICDEM Mechatronics Demo Board   –  PIC16F917

    Could anyone help or reply with a quote for writing the code please.

    Thanks

    Omotoso Omoniyi
    Participant

    Hi guys, i have followed the tutorials on

    1.  Using UART of PIC Microcontroller – MPLAB XC8 at https://electrosome.com/uart-pic-microcontroller-mplab-xc8/

    2. Using UART on raspberry Python. Link at https://electrosome.com/uart-raspberry-pi-python/

    The project i am working on will have me send pure strings(texts) from raspberry Pi to PIC and vice versa using UART, I have wired the circuit as expected but the message i am getting on the raspberry Pi and on the PIC is sort of garbled. I do not know what is responsible for this, please does anyone have an idea of what i should do to get the messages in the write format. Thanks!

    #11460
    Shengo
    Participant

    Hi there, below is the code I tried to write according to your tutorials:

    void main()
    {
      TRISD.F0 = 1; //RD0 as Input PIN 1
      TRISD.F1 = 1; //RD1 as Input PIN 2
    
      TRISB.F0 = 0; //RB0 as Output PIN 1
      TRISB.F1 = 0; //RB1 as Output PIN 2
    
      PORTB.F0 = 0; //Motor clockwise direction flow OFF
      PORTB.F1 = 0; //Motor anticlockwise direction flow OFF
    
      do
      {
        if(PORTD.F0 == 0) //If Switch is presseed
        {
          delay_ms(100); //Provides required delay
          if(PORTD.F0 == 0) //If Switch is still pressed
          {
            PORTB.F0 = 1; //Motor turns in clockwise direction
            if(PORTD.F1 == 1) //If Signal is sent from proximity sensor
            {
              PORTB.F0 = 0;
              PORTB.F1 = 1;
              delay_ms(10000);
              PORTB.F1 = 0; //After 10 seconds the motor is turned off
            }
          }
        }
      }while(1);
    }

    The part where the proximity sensor sends a signal, if(PORTD.F1 == 1), the input should be 1 right?

    Also, do you need a constant flow of current from input, in order for the output to be able to work constantly? Like if I press the switch once, the motor turns clockwise, but if I cut off the current from the switch, will the motor still keep turning or it will stop??

    Furthermore, will this code works in MPLAB or Hi-tech? I know the code is almost similar with just a slight modification, just need to know about this, if I want to program them in other software, anything else to add to the code?

    One more question, the voltage of the signal sent from my proximity sensor is quite high, which my PIC16F877A couldn’t stand the voltage as the maximum is 5V, so any solution to this to lower down the signal voltage from my proximity sensor? I’ve searched the internet, I found something about opto-isolator, can I use that?

    Your help is greatly appreciated as this is a very urgent project, thanks.

    #10954

    In reply to: PWM by pic 16F877A

    Ligo George
    Keymaster

    For MPLAB you can use the following link.

    Generating PWM with PIC Microcontroller – MPLAB Hi-Tech C

    That code is working fine for me.

     

    #10953

    In reply to: PWM by pic 16F877A

    sandeep
    Participant

    Hi Ligo,

    As i also have problem on pwm,  so i thought posting my doubt over here is fine.but i work on mplab.

    I just tried to run a pwm with the duty cyle of 78% of the period, but it is not working on proteous, suggestions pls.

    void main()
    {
      PR2=0xFF;//setting period=0.0002048
      CCP1CON=0b00001100;//setting to pwm mode<3:0> and duty value<5:4>
      CCPR1L=0xC8;    //setting value of 800 to make duty=0.00016,which
      //is 78% of period.
      //T2CON=0b00000001;//prescale<1:0> of1:4
      T2CKPS0=1;
      T2CKPS1=0;
      TMR2ON=1;       //timer2 is on i.e clock pulses are provided.
    }
    
    #10870

    In reply to: USART PIC16F877A

    Ligo George
    Keymaster

    MikroC functions are 100% working..

    You can use the following MPLAB XC8 tutorial to write your own functions.

    Using UART with PIC Microcontroller – MPLAB XC8

    #10277
    sahu
    Participant

    How to display floating point values on LCD ? I am using MPLAB XC8 LCD Library.

    #10165
    Ivan
    Participant

    I’m trying send data to the PIC using the Terminal Window on Proteus, but something is wrong and I don’t understand why. I attached the Proteus project and *.HEX.

    The PIC is 16F628a.

    #define _XTAL_FREQ 8000000
    
    #define RS RB0
    #define EN RB3
    #define D4 RB4
    #define D5 RB5
    #define D6 RB6
    #define D7 RB7
    
    #include <xc.h>
    #include "lcd.h"
    #include "uart.h"
    
    #pragma config FOSC = INTOSCCLK // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN)
    #pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
    #pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
    #pragma config MCLRE = OFF      // RA5/MCLR/VPP Pin Function Select bit (RA5/MCLR/VPP pin function is digital input, MCLR internally tied to VDD)
    #pragma config BOREN = ON       // Brown-out Detect Enable bit (BOD enabled)
    #pragma config LVP = OFF        // Low-Voltage Programming Enable bit (RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming)
    #pragma config CPD = OFF        // Data EE Memory Code Protection bit (Data memory code protection off)
    #pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)
    
    void main()
    {
      TRISB = 0b000000110;
      TRISA0 = 0;
    
      Lcd_Init();
      Lcd_Clear();
      Lcd_Set_Cursor(1,1);
      Lcd_Write_String("WAITING...");
    
      UART_Init(9600);
      UART_Write_Text("Terminal is running!");
    
      while(1)
      {
        if(UART_Data_Ready())
        {
          Lcd_Clear();
          RA0 = 1;
          Lcd_Write_String(UART_Read_Text);
          __delay_ms(1000);
        }
      }
    }
    

    The UART.h and LCD.h from https://electrosome.com/lcd-pic-mplab-xc8/ and https://electrosome.com/uart-pic-microcontroller-mplab-xc8/

    Somebody know why the code is not working?

Viewing 15 results - 16 through 30 (of 31 total)
>