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

Cant get Tris command to be accepted on compile, Need help

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



Joined: 20 Dec 2014
Posts: 69
Location: Arizona

View user's profile Send private message Visit poster's website

Cant get Tris command to be accepted on compile, Need help
PostPosted: Sat Dec 27, 2014 10:35 am     Reply with quote

Hello,

I'm using the E3 book/board package to learn C, and all has gone well except for this morning when I tried to use the tris command to set the i/o directions separately. Every time I try to compile, it fails and gives me the error: expect declaration.

This is right out of the manual for an example, and won't work

it always highlights the (0x0F) and gives me the error code.

any ideas?

Here is the code:

Code:
/*I/O testing of ports and pins*/

#include <e3.h>

#use fast_io(C)

set_tris_c( 0x0F );



void main() {
 
 
   
}
temtronic



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

View user's profile Send private message

PostPosted: Sat Dec 27, 2014 10:55 am     Reply with quote

and we're supposed to guess which PIC you're using ???

main has nothing in it, so I'll assume the PIC's going to sleep though without a compiler version, I'm guessing....

also no idea what's in the e3.h file, that could be causing all sorts of 'issues'.
Ttelmah



Joined: 11 Mar 2010
Posts: 19368

View user's profile Send private message

PostPosted: Sat Dec 27, 2014 11:21 am     Reply with quote

The answer is simple. set_tris_x, is a program command, not a preprocessor directive. It has to be in the code.....
Arizona Chris



Joined: 20 Dec 2014
Posts: 69
Location: Arizona

View user's profile Send private message Visit poster's website

it WORKED. thank you!
PostPosted: Sat Dec 27, 2014 11:33 am     Reply with quote

Thank you "Ttelmah". That gives me no errors. Now I can try to send commands to the ports.

Temptronic - Ive gotten in the habit for 15 years of programming micros (obviously with other languages) to compile what I have so far ever so often so I can tell if I made a mistake. This is a base blank program to add to later. The E3 is a small board with an 18F14K50 that CCS sells with a book so you can learn C. Im on the chapter now dealing with ports and I/os.

Chris
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