Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

C and Assembly

Status
Not open for further replies.
antivir pro I would have just told it not check it no more but I lost all my file on this computer about 4 months ago when I moved to bigger hard drive I looked on the net and I'm not the only one that has had this happen
 
Last edited:
It drives my antvir crazy and i have removed it and SourceBoost works fine
For now. Sooner or later you're going to need that file. :p

Comodo doesn't think it's a virus either.

I've only run into Antivir once before on a customer's HORRIBLY malwared & trojaned machine. The OS couldn't be saved without more work than it was worth doing. Formatted and started over. That job gave me a pretty low opinion of Antivir. :D
 
hey guys this is a nice topic. I want to start using 16F pics again also and want to confirm you guys recommend BoostC right? I want to write in C mainly for portability.

I just dowloaded boostC. My pic of choice to test and play is a PIC16F627A and i wanted to know. With boostC can it be MPLAB friendly? Like can i compile from MPLAB? I havent tried it in a while lol.

Scratch that i just installed and it asked me lol

Can someone post a small blink led sample please. So i know how to setup any configs and such.
 
Last edited:
Given that you have used C18 this may help. It is a header file that allows code to be used with either C18 or BoostC. It is for the 18F1320 but it provides the flavor of what the diffs are and what you need to do. Note that the user code uses lata_ instead of that used by either compiler.
Code:
#ifdef _BOOSTC
  #define FOUND_COMPILER
  
  #define lata_     lata
  #define trisa_    trisa
  #define porta_    porta
  
  #define latb_     latb
  #define trisb_    trisb
  #define portb_    portb
  
  #define intcon_   intcon
  #define intcon2_  intcon2
  #define osccon_   osccon
  #define t0con_    t0con
  #define t0con__   t0con
  #define adcon1_   adcon1
  
  #include <system.h>
  #pragma CLOCK_FREQ 8000000
  #pragma DATA _CONFIG1H, _INTIO2_OSC_1H
  #pragma DATA _CONFIG2H, _WDT_OFF_2H
  #pragma DATA _CONFIG3H, _MCLRE_ON_3H
  #pragma DATA _CONFIG4L, _LVP_OFF_4L
#endif

// MCC18
#ifdef __18CXX
  #define FOUND_COMPILER
  
  #define lata_     LATA
  #define trisa_    TRISA
  #define porta_    PORTA
  
  #define latb_     LATB
  #define trisb_    TRISB
  #define portb_    PORTB
  
  #define intcon_   INTCONbits
  #define intcon2_  INTCON2bits
  #define osccon_   OSCCONbits
  #define t0con__   T0CONbits  
  #define t0con_    T0CON
  #define adcon1_   ADCON1
  
  #pragma	config OSC = INTIO2, WDT = OFF, LVP = OFF
  #include <p18f1320.h>
  
  void interrupt(void);
  
  #pragma code low_vector=0x18
  void low_interrupt (void)
  {
    _asm GOTO interrupt _endasm
  }
  #pragma code
  #pragma interruptlow interrupt
  
#endif

#ifndef FOUND_COMPILER
   error: unknown compiler
#endif
 
hey guys this is a nice topic. I want to start using 16F pics again also and want to confirm you guys recommend BoostC right? I want to write in C mainly for portability.

I just dowloaded boostC. My pic of choice to test and play is a PIC16F627A and i wanted to know. With boostC can it be MPLAB friendly? Like can i compile from MPLAB? I havent tried it in a while lol.

Scratch that i just installed and it asked me lol

Can someone post a small blink led sample please. So i know how to setup any configs and such.


It is all at ( for an 877 ) **broken link removed** and BoostC is excellent, full version is very reasonably priced. Works on 16F and 18F series.
Will work with MPLab, but its own IDE is fine, maybe better.
 
Boost C looks real good a lot more how to's now that I no it's not going to kill my computer I tried it fist from John main site.
 
damn ...
Code:
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\SourceBoost\boostc.pic16.exe" test.c -O1  -W1  -t 16F627A
Thread would not exit normally.
Could not read language tool output from pipe.  (5)
BUILD FAILED: Sat Feb 28 21:23:29 2009
 
Code:
#include <system.h>
#include <PIC16F627A.h>
#pragma CLOCK_FREQ 4000000
#pragma DATA _CONFIG, _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _LVP_OFF

void main()
{
    trisa = 0x00;
    set_bit( porta, 0 ); 

    while(1);
}
 
Compiles fine on my XP SP2 laptop, MPLAB (8.14), BoostC (6.91) combination...

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\SourceBoost\boostc.pic16.exe" Atomsoft.c -O1 -W1 -t 16F627A
BoostC Optimizing C Compiler Version 6.91 (for PIC16 architecture)
SourceBoost Technologies - Home of BoostC Free PIC C Compiler and BoostBasic Free Pic Basic Compiler
Copyright(C) 2004-2008 Pavel Baranov
Copyright(C) 2004-2008 David Hobday

Single user Lite License (Unregistered) for 0 node(s)
Limitations: PIC12,PIC16 max code size:2048 words, max RAM banks:2, Non commercial use only


Atomsoft.c

success
Executing: "C:\Program Files\SourceBoost\boostlink.pic.exe" "C:\Development\PIC Projects - Boost C\Atomsoft.obj" -O1 -p "Atomsoft" -t 16F627A
BoostLink Optimizing Linker Version 6.91
SourceBoost Technologies - Home of BoostC Free PIC C Compiler and BoostBasic Free Pic Basic Compiler
Copyright(C) 2004-2008 Pavel Baranov
Copyright(C) 2004-2008 David Hobday


Optimisation level:1
Building CASM file

Memory Usage Report
===================
RAM available:224 bytes, used:0 bytes (0.0%), free:224 bytes (100.0%),
Heap size:176 bytes, Heap max single alloc:95 bytes
ROM available:1024 words, used:10 words (1.0%), free:1014 words (99.0%)


success
Loaded C:\Development\PIC Projects - Boost C\Atomsoft.COF.
BUILD SUCCEEDED: Sat Feb 28 22:47:33 2009
 
Last edited:
It Compiles fine in SourceBoost IDE are you building from C:\ I get errors like that when I try to build a file I have on my desktop dum idea but when it late some times for get lol
 
how will it no what chip if you don't tell it
Jason! Leave out the #include <PIC16F627A.h>
you need that for a Quick build
 
Last edited:
how will it know what chip if you don't tell it

It knows because the device is defined in the MPLAB project and passed along to the BoostC compiler when you execute the build command...

The project compiles fine with or without the "include <PIC16F627A.h>" line
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top