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

bug report + documentation error: no P2B in eccp half bridge

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



Joined: 10 Jan 2013
Posts: 68

View user's profile Send private message

bug report + documentation error: no P2B in eccp half bridge
PostPosted: Mon Apr 08, 2013 4:24 pm     Reply with quote

I noticed a bug in my CCS 4.130 so I post it just in case someone will search about it:
In pic18f26k22 when eccp2 is in half bridge mode and p2b is set to be multiplexed on RB5 in fuses, the compiler does not clear the TRIS bit for RB5. The programmer should do it using output_drive(pin_B5);.

And there is an error in documentation for parameters of getenv function:
Quote:

SFR:name
Returns the address of the specified special file register. The output format can be used with the preprocessor command #bit. name must match SFR denomination of your target PIC (example: STATUS, INTCON, TXREG, RCREG, etc)

BIT:name
Returns the bit address of the specified special file register bit. The output format will be in “address:bit”, which can be used with the preprocessor command #byte. name must match SFR.bit denomination of your target PIC (example: C, Z, GIE, TMR0IF, etc)


That should be exatly the opposite of that.
temtronic



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

View user's profile Send private message

PostPosted: Mon Apr 08, 2013 4:39 pm     Reply with quote

Hopefully, you'll report your findings to ccs directly. They don't monitor this forum.

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19332

View user's profile Send private message

PostPosted: Tue Apr 09, 2013 12:17 am     Reply with quote

Generally though, the compiler does not handle TRIS for anything with re-mappable pins. If you select the alternative address on UART's, PWM's etc., it becomes your responsibility to handle TRIS.
It should be made clear, but it is quite well documented here.

Best Wishes
notbad



Joined: 10 Jan 2013
Posts: 68

View user's profile Send private message

PostPosted: Tue Apr 09, 2013 5:29 am     Reply with quote

Dear Ttelmah
What do you mean by “It should be made clear, but it is quite well documented here.”? Sorry my English is really embarrassing! Are you saying that the problem with TRIS is documented somewhere? Where? By who?

Besides, sometimes I see some users, including you, answer questions with information that I don’t know where they come from!
I mean all I have is a manual for CCS and a book titled “An Introduction to Programming the Microchip PIC in CCS C”.
How do you know all this stuff?
Ttelmah



Joined: 11 Mar 2010
Posts: 19332

View user's profile Send private message

PostPosted: Tue Apr 09, 2013 8:40 am     Reply with quote

The point is that for most compiler versions, and most peripherals, if you set fuses to move the peripheral to alternate pins, the compiler stops handling TRIS for you. It only handles the default addresses.
It is a problem, since in general it is so easy to let the compiler do it for you, and for most programmers, it is often said 'let the compiler handle TRIS'. It's a pity that there isn't a comment with the fuse setting along the lines of 'if you use this, you will have to handle TRIS yourself'...
On where have people., learnt. By doing & reading.

Best Wishes
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