Jump to content

Extremely Easy Question! Newb Needs Help!


Recommended Posts

Hey guys its me again with another ignorant newbie question...

 

I am trying to just get SOMETHING to compile. I am using PICSTART Plus for a programmer and was planning on using it to set my configuration word. Can someone please explain why this code will not compile? I don't care that this code doesn't really do much, thats not the purpose of it. I just want to get the hang of the compiler first.

 

#include <system.h>
#pragma CLOCK_FREQ 1000000;

main()
{
TRISC=0x00;
PORTC=0x01;	
return 0;
}

This is the error that I get

Building...

BoostC Optimizing C Compiler Version 6.60 (for PIC16 architecture)

http://www.sourceboost.com

Copyright© 2004-2006 Pavel Baranov

Copyright© 2004-2006 David Hobday

 

Licensed to Yefim Fundyler under Single user Pro License for 1 node(s)

Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited

 

 

Test_1.c

 

failure

C:\Documents and Settings\JohnWilson\Desktop\Code Test 1\Test_1.c(6:8): error: left operand must be l-value

C:\Documents and Settings\JohnWilson\Desktop\Code Test 1\Test_1.c(6:8): error: failed to generate expression

C:\Documents and Settings\JohnWilson\Desktop\Code Test 1\Test_1.c(7:8): error: left operand must be l-value

C:\Documents and Settings\JohnWilson\Desktop\Code Test 1\Test_1.c(7:8): error: failed to generate expression

"C:\Program Files\SourceBoost\boostc.pic16.exe" Test_1.c -t PIC16F913

Exit code was 1.

Removing target: Test_1.obj

Done

Link to post
Share on other sites

C is case sensitive. portc and trisc have been defined in the header file for the processor you are using. PORTC and TRISC have not been defined.

 

I changed TRISC to trisc and PORTC to portc and it compiles?

 

Can someone explain this to me?  I always used capital letters when programming in other compilers.

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...