View previous topic :: View next topic |
Author |
Message |
notbad
Joined: 10 Jan 2013 Posts: 68
|
bug report + documentation error: no P2B in eccp half bridge |
Posted: Mon Apr 08, 2013 4:24 pm |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Mon Apr 08, 2013 4:39 pm |
|
|
Hopefully, you'll report your findings to ccs directly. They don't monitor this forum.
hth
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Tue Apr 09, 2013 12:17 am |
|
|
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
|
|
Posted: Tue Apr 09, 2013 5:29 am |
|
|
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: 19515
|
|
Posted: Tue Apr 09, 2013 8:40 am |
|
|
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 |
|
|
|