go_away

Author Topic: PIC Programing  (Read 875 times)

0 Members and 1 Guest are viewing this topic.

Offline RubyTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
PIC Programing
« on: June 14, 2013, 06:10:38 AM »
Hi all. I am very new at PIC's so please be patience. I have bought pic18f2455 and pic18f2550 and pic6F877A. I have K150 and it's program to write the program to pic. The thing is I don't know which program I need to use to write program in C!!! And than I need a compiler to convert the program from C to HEX ; am I right?
I have already downloaded the MPLAB X IDE v1.80 but I have getting problems when I want to build the C.
Example:
#include <htc.h>
#include <pic.h>
#include <delay.c>

main()
{
    TRISB=0; // declare portb as outpot
   
    for(;;)  // do forever
    {
        RB0=1;    // LED ON
        DelayMs(250);  // delay for 0.25 seconds
        RB0=0;      // LED OFF
        DelayMs(250);
    }
}
Please HELP!!!!

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: PIC Programing
« Reply #1 on: June 14, 2013, 10:19:00 AM »
Quote
I have getting problems when I want to build the C

Step 1: Copy and paste the actual errors you're getting. Else nobody will know what kind of problems you're having.

Offline RubyTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Re: PIC Programing
« Reply #2 on: June 14, 2013, 11:17:29 AM »
Like this....
Now I paid attention; is it possible that libraries are missing?
« Last Edit: June 14, 2013, 11:33:12 AM by Ruby »

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: PIC Programing
« Reply #3 on: June 14, 2013, 11:57:25 AM »
I see no error messages in that screen shot. I do see a missing "#" at the top of the file, though.

Offline RubyTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Re: PIC Programing
« Reply #4 on: June 14, 2013, 12:44:22 PM »
What about red exclamation points?

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: PIC Programing
« Reply #5 on: June 14, 2013, 04:55:58 PM »
Ask yourself this: Why would someone ask you for what the error messages say when you're asking for help?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,928
  • Helpful? 98
Re: PIC Programing
« Reply #6 on: June 14, 2013, 06:15:42 PM »
Getting started does take a bit of time and study.
I suggest this great tutorial on how to use and program PICs.
http://www.gooligum.com.au/tutorials.html

Note: You do not need to buy anything to do most of the lesson. JUST MPLAB and its built-in Simulator.

Also note: MPLAB's Help is very good with tutorials. The Help is well worth reading.

Offline RubyTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Re: PIC Programing
« Reply #7 on: June 15, 2013, 05:11:03 AM »
Hi guys. I have downloaded "mikroC PRO for PIC" and everything goes ok. Leds are blinking :)
Thank you.

Offline fireintheit

  • Jr. Member
  • **
  • Posts: 14
  • Helpful? 0
Re: PIC Programing
« Reply #8 on: June 28, 2013, 01:32:46 PM »
If you are looking for text editor that support C then try visual basics C++. This text editor has some good features, like the debugger.

 


Get Your Ad Here