• AVR Freaks

Hot!pass pic ccs compiler code to mplab ide and c16 with dspic30f4013

Author
jose_pic16F
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2020/01/21 12:12:24
  • Location: 0
  • Status: offline
2020/04/02 08:48:53 (permalink)
0

pass pic ccs compiler code to mplab ide and c16 with dspic30f4013

hello guys greetings, well I have designed a small code in ccs compiler that is a voltmeter with dspic30f4013, I know that proteus does not have this library, much less has the library for pic 32.
I am using the multisim simulator version 14.02 and I have added the dspic 30f and pic 32 libraries, and the java version 7.8. but when simulating the circuit with the dspic 30f4013 it generates an error, since the simulator only accepts files with extension cof and elf, and the ccs only generates the cof, but when simulating it does not accept it.
only accepts files with mplab x ide cof and elf extensions.
this is the code in ccs
#include <30F4013.h>
#Fuses NOWDT, HS2_PLL16, MCLR, NOPROTECT, RESERVED, NOWRT
#device adc = 12
#use delay (clock = 4000000)
#define LCD_ENABLE_PIN PIN_D0
#define LCD_RS_PIN PIN_D1
#define LCD_RW_PIN PIN_D2
#define LCD_DATA4 PIN_F5
#define LCD_DATA5 PIN_F4
#define LCD_DATA6 PIN_F1
#define LCD_DATA7 PIN_F0
#include <lcd.c>
#include <math.h>
#include <stdlib.h>
float voltage;
float Lect_adc;
void main ()
{
 Lect_adc = 0;
 voltage = 0;
 lcd_init ();
 setup_adc_ports (sAN0 | VREF_VREF);
 setup_adc (ADC_CLOCK_DIV_32 | ADC_TAD_MUL_2);
 while (true)
 {
  set_adc_channel (0);
  Lect_adc = read_adc ();
  delay_ms (20);
  voltage = ((20.0 * Lect_adc) / 4095);
  lcd_putc ("\ f");
  lcd_gotoxy (1,2);
  printf (lcd_putc, "Voltage =% f", Voltage);
  delay_ms (500);
 }
}
 
I want this same code, that if changing these instructions but in the mplab x ide and in compiler xc16
I hope and you can help me guys and thanks :(
#1

1 Reply Related Threads

    jose_pic16F
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2020/01/21 12:12:24
    • Location: 0
    • Status: offline
    Re: pass pic ccs compiler code to mplab ide and c16 with dspic30f4013 2020/04/03 08:00:56 (permalink)
    0
    Hello friends, best regards, good, I tell you I have a problem when compiling a ccs code in mplab x ide, I have installed the ccs plugin in mplab x ide as shown in the video developed by ccs, but when compiling the ccs code in mplab x ide generates a compilation error, I attach the corresponding image.
    I share it on google drive.
    https://drive.google.com/file/d/1mv66SgxVdmFL93YAkbs_4_3-T4nzyP7d/view?usp=sharing
    https://www.youtube.com/watch?v=uziNEmDdF3g video ccs plugin video with mplab x ide 
     
    also this code with the ccs compiler does NOT generate any error and compiles me without any problem and generates the hex file.
    I am trying to compile it in mplab x ide so that it generates the file with the elf extension. reason the dspic 30f4013 proteus does not have its libraries, and the multisim simulator does have this dspic, and the multisim only accepts files with an elf extension.

    and the ccs plugin for mpla x ide has worked for me a little, but now compiling this code is giving me an error.

    I hope your help again and thanks sad: sad


     
     
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5