CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

programing

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kabiru



Joined: 20 Jul 2012
Posts: 6
Location: Nigeria

View user's profile Send private message Send e-mail

programing
PostPosted: Sat Jul 21, 2012 8:04 am     Reply with quote

Hello everyone, I am new to this forum and also new to microcontrollers programing. I will like members to please help me with some tutorial to start with...
Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 22, 2012 12:26 pm     Reply with quote

Here are some threads that have links to tutorials:
http://www.ccsinfo.com/forum/viewtopic.php?t=44291
http://www.ccsinfo.com/forum/viewtopic.php?t=41217
http://www.ccsinfo.com/forum/viewtopic.php?t=36598

You need to learn the C language by yourself, and not on this forum.
We don't want to teach you about C. We will help you with the
CCS compiler, and explain how it's different than standard C, but
we don't want to teach you the simple basics of the C language
such as the while() statement, or the for() loop, main(), variables, etc.
You must learn all them all by yourself.
kabiru



Joined: 20 Jul 2012
Posts: 6
Location: Nigeria

View user's profile Send private message Send e-mail

PostPosted: Sun Jul 22, 2012 3:40 pm     Reply with quote

Thank you for the reply pcm programer, i am learning the basics of c language and i am understanding it very well,also thank's for the links....
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Sun Jul 22, 2012 11:58 pm     Reply with quote

If you like video tutorials, Lynda.com has a series on C/C++ and while some of it is specific to windows etc, much of the course discusses C fundamentals. Check it out at
http://www.lynda.com/Eclipse-tutorials/CC-Essential-Training/94343-2.html
I have no association with Lynda.com other than through my credit card (I pay the annual fee). Much of the basics he covers will also apply to the CCS compiler we use here.

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Ttelmah



Joined: 11 Mar 2010
Posts: 19358

View user's profile Send private message

PostPosted: Mon Jul 23, 2012 3:49 am     Reply with quote

I think you first need to be very sure whether micro controllers at this level are the way you need/want to go.

The 'point' about the PIC's as a whole, is a huge family of very cheap chips, ideal primarily for small jobs, or where very large quantities are to be used.

However if (for instance), I wanted to control something simple, and have a simple interface to do this, without having to get involved with soldering irons, or making PCB's, a much better 'learning' starting point, would be something like the Arduino, where interface components are available to 'plug on', or the Raspberry Pi, where a complete board with basic OS, and language is available.

If you decide you do want to go the PIC route, start with a basic C tutorial, and a standard C on the PC first. Get happy that you can write and understand a number of simple programs _before_ getting involved in the extra complexity of working directly with a programmable processor. Then step _slowly_, by getting a pre-built 'development' board.

Best Wishes
kabiru



Joined: 20 Jul 2012
Posts: 6
Location: Nigeria

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 23, 2012 4:48 am     Reply with quote

This is a very nice forum where different people and different opinions joined together to share ideas, @ Ttelmah I am happy for your advice but I didn't thought about arduino earlier or raspberry pi. A friend advice me to start with pic and now i can understand and write small program like led blinking i think is a good starting point don't you think so?
kabiru



Joined: 20 Jul 2012
Posts: 6
Location: Nigeria

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 24, 2012 8:08 am     Reply with quote

Hello every one i write a simple led blinking code but when trying to compile their wont be hex file here is the code..





#include<16f877.h>
#fuses HS,NOWDT,NOLVP,NOPROTECT
#use delay(clock=20M)


void main()

{


while(1)

{

output_high(PIN_BO);
delay_ms (1000);
output_low(PIN_BO);
delay_ms(1000);

}


}
Ttelmah



Joined: 11 Mar 2010
Posts: 19358

View user's profile Send private message

PostPosted: Tue Jul 24, 2012 8:17 am     Reply with quote

Study the forum - _code buttons_.....

Code:

#include<16f877.h>
#fuses HS,NOWDT,NOLVP,NOPROTECT
#use delay(clock=20M)

void main(void) {
   while(TRUE) { //just nicer style....
      output_toggle(PIN_B0); //again nicer style - note the pin name
      delay_ms (1000);
   }
}


Saved as (say) 'test.c', this _will_ compile and generate a hex file, provided you are calling the compiler correctly. What you post, _should work_, except you have called the pins 'BO', rather than 'B0', and the compiler should give an error that the former is not defined. If this is not the problem, how are you trying to compile this?. Through the IDE?. Command line?. MPLAB?.
Note how using the code buttons, and indenting, makes the code easier to read.

Best Wishes
kabiru



Joined: 20 Jul 2012
Posts: 6
Location: Nigeria

View user's profile Send private message Send e-mail

Timer and prescalers
PostPosted: Tue Jul 24, 2012 8:32 am     Reply with quote

Very nice one Ttelmah it works Laughing you know i am a beginner that's quit encouraging thanks, and please can you help me with any tutorial to learn how to set timers, in pic?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Jul 24, 2012 10:39 am     Reply with quote

I don't want to sound rude or harsh, but you've already been told this is a help you forum not a do it for you one.

All the information you need is in the microchip data sheets for the PIC you're using and the CCS manual.

I suggest you:-

(1) Read the CCS forum guide.
(2) Have a go at getting the timers to do what you want.
(3) Come back to the forum when you are stuck.

When you need help show us that you have tried, someone will usually offer assistance.

Mike

EDIT You will also find loads of useful examples supplied with the CCS compiler, and on this forum.
kabiru



Joined: 20 Jul 2012
Posts: 6
Location: Nigeria

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 24, 2012 11:08 am     Reply with quote

Thank you
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jul 24, 2012 11:16 am     Reply with quote

You can learn a lot by reading the forum archives. Learn to use the
forum's search page. It's right here:
http://www.ccsinfo.com/forum/search.php

To search for tutorials on timers, type this into the top box:
Quote:
timer* tutorial*

And set it to "Search for all Terms" (That's very important).

Click the Search button and you will find lots of articles to read. Most
questions have already been answered and you can find the answers with
the search page.
W4GNS



Joined: 28 Sep 2010
Posts: 14
Location: Virginia, USA

View user's profile Send private message

PostPosted: Tue Jul 24, 2012 11:56 am     Reply with quote

Kabiru
Welcome to the forum and:

Also download this Microchip doc, lots of useful information here.
http://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf
_________________
PCWH 4.14
temtronic



Joined: 01 Jul 2010
Posts: 9169
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jul 24, 2012 12:43 pm     Reply with quote

Also have a real good look at the examples CCS supplies in the 'examples' folder. It will give you practical real world knowledge how to interface almost any device to a PIC.
Please not that you should look at them all, as they all have nice information in them !!
As well, when you have your project open, pressing F11 opens up the CCS help files, allowing fast access to most everything you might need to know, especially for beginner status.

hth
jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group