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

HELP Problem of "set_tris_e" at 16LF1937

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



Joined: 18 Mar 2010
Posts: 7

View user's profile Send private message

HELP Problem of "set_tris_e" at 16LF1937
PostPosted: Thu Mar 18, 2010 6:29 am     Reply with quote

Now I have trouble at compiling "set_tris_e".
I can compile set_tris_a, set_tris_b, set_tris_c, and set_tris_d.
But I cannot compile set_tris_e.

After compiling set_tris_e, Disassembly list at MPLAB SIM is following.
Code:

24:                   set_tris_a( 0x02 );
  001F    3002     MOVLW 0x2
  0020    008C     MOVWF 0xc
25:                   set_tris_b( 0xFF );
  0021    30FF     MOVLW 0xff
  0022    008D     MOVWF 0xd
26:                   set_tris_c( 0x04 );
  0023    3004     MOVLW 0x4
  0024    008E     MOVWF 0xe
27:                   set_tris_d( 0x00 );
  0025    3000     MOVLW 0
  0026    008F     MOVWF 0xf
28:                   set_tris_e( 0x0C);
  0027    1009     BCF 0x9, 0
  0028    1089     BCF 0x9, 0x1
  0029    1489     BSF 0x9, 0x1
  002A    1489     BSF 0x9, 0x1

No resistor settings are occurred at trise.
Please show me how to fix it, or some alternatives.

Current source file is following (test version).
Code:

#include "include.h"

#fuses INTRC_IO,NOWDT,PUT,NOMCLR,NOPROTECT,NOCPD,NOBROWNOUT,NOCLKOUT,NOIESO,NOFCMEN,NOWRT,PLL,NOSTVREN,BORV19,LVP

#use delay(clock=8000000)


void main( void )
{
   set_tris_a( 0x02 );
   set_tris_b( 0xFF );
   set_tris_c( 0x04 );
   set_tris_d( 0x00 );
   set_tris_e( 0x0C);


   while( 1 )
   {
   }
}

using environment is as follows.

Device:
16LF1937

Version:
CCS PCM 4.104
MPLAB IDE 8.46

regard.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 18, 2010 12:41 pm     Reply with quote

I tested your program with vs. 4.105 and it failed in the same way.

As a work-around, you can write directly to the TRISE register, as
shown below in bold:
Quote:

#byte TrisE = 0x90 // Tell compiler the address of TRISE

void main( void )
{
set_tris_a( 0x02 );
set_tris_b( 0xFF );
set_tris_c( 0x04 );
set_tris_d( 0x00 );
set_tris_e( 0x0C );

TrisE = 0x0C; // Write directly to TRISE register

while(1)
{
}
}


Note the correct code generated for the work-around statement below:
Code:

....................    set_tris_a( 0x02 ); 
001F:  MOVLW  02
0020:  MOVWF  0C
....................    set_tris_b( 0xFF ); 
0021:  MOVLW  FF
0022:  MOVWF  0D
....................    set_tris_c( 0x04 ); 
0023:  MOVLW  04
0024:  MOVWF  0E
....................    set_tris_d( 0x00 ); 
0025:  MOVLW  00
0026:  MOVWF  0F
....................    set_tris_e( 0x0C ); 
0027:  BCF    09.0
0028:  BCF    09.1
0029:  BSF    09.2
002A:  BSF    09.3
.................... 
.................... TrisE = 0x0C;  // Work-around fix
002B:  MOVLW  0C   
002C:  MOVWF  10
.................... 

This bug needs to be reported to CCS support. Tell them the PIC,
the version (and that it fails in vs. 4.105), and show them the test
program and the .LST file. Then they can fix it quickly.
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Thu Mar 18, 2010 1:45 pm     Reply with quote

I reported this to Darren a couple of days ago. Also note that the 16F1937.h file in 4.105 is corrupted. Some of the set up parameters are missing for timer 1.

http://www.ccsinfo.com/forum/viewtopic.php?t=41522
YASU



Joined: 18 Mar 2010
Posts: 7

View user's profile Send private message

Thanks
PostPosted: Tue Mar 23, 2010 11:49 am     Reply with quote

I could manage this problem by using alternative shown.
Thanks.
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