TRIS settings

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
stryzbiak
Posts: 37
Joined: 13 May 2013 00:17
Location: Tulsa, OK

TRIS settings

#1 Post by stryzbiak » 23 May 2016 16:22

I think I am using TRIS incorrectly. Can Someone give me the correct format for miKroC 32 bit PIC32MX795F510L?


TRISAbits.TRISA1 = 1;

errors:

13 402 ; expected, but '.' found GM 5-23-2016.c
13 393 'TRISAbits' Identifier redefined GM 5-23-2016.c
13 371 Specifier needed GM 5-23-2016.c
13 396 Invalid declarator expected'(' or identifier GM 5-23-2016.c

paulfjujo
Posts: 1558
Joined: 24 Jun 2007 19:27
Location: 01800 St Maurice de Gourdans France
Contact:

Re: TRIS settings

#2 Post by paulfjujo » 23 May 2016 17:08

hello,

for 18F PIC ( 8 bits MCU)
we can use this syntax

TRISA.F1=1;
TRISA.B1=1;
TRISA1_bit=1;

with :
TRISAbits.TRISA1 = 1;
i don't get any error in compiling ...

maybe your problem is elsewhere..

i don't know if syntax is the same for PIC32 !

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: TRIS settings

#3 Post by p.erasmus » 23 May 2016 17:42

Hi Your syntax is correct that is also the standard way for the MCHP compiler syntax I would advise you to
make bug report at mE help desk
as a work around use the mE style
TRISA1_bit that compiles correctly as you can see from my screen print
Attachments
23.05.jpg
23.05.jpg (161.13 KiB) Viewed 3017 times
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

stryzbiak
Posts: 37
Joined: 13 May 2013 00:17
Location: Tulsa, OK

Re: TRIS settings

#4 Post by stryzbiak » 23 May 2016 21:46

Thanks for the help. I will double check my work.

Sid

User avatar
uros.cvetinovic
mikroElektronika team
Posts: 803
Joined: 14 Dec 2015 09:24

Re: TRIS settings

#5 Post by uros.cvetinovic » 26 May 2016 09:52

Hi,

Can you please zip and send your project where you are using this line:
TRISAbits.TRISA1 = 1;

I tried it in our compiler, and it gives no error when compiling for PIC32MX795F512L.

Best regards,

Uros

stryzbiak
Posts: 37
Joined: 13 May 2013 00:17
Location: Tulsa, OK

Re: TRIS settings

#6 Post by stryzbiak » 26 May 2016 21:12

GOT RID OF JTAGEN AND PROBLEM WENT AWAY.

JTAGEN = 0;

Thanks,

Sid

Post Reply

Return to “mikroC PRO for PIC General”