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 CCS Technical Support

lst file miss labels

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



Joined: 02 May 2010
Posts: 1

View user's profile Send private message

lst file miss labels
PostPosted: Tue Jun 22, 2010 10:22 am     Reply with quote

Hi, I'm working with 18f46j11, v4.093, and the problem is that the time change form 23:59:59 to 20:0:0 and I´ve read rtc_write() doesn´t work properly.

my code:
Code:

#include <18F46J11.h>

#FUSES  NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH(>10mhz for PCD) 
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NOPROTECT                //Code not protected from reading
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES IOL1WAY                  //Allows only one reconfiguration of peripheral pins
#FUSES PRIMARY                  //Primary clock is system clock when scs=00
#FUSES NOWPCFG               
#FUSES WPBEG                 
#FUSES WPDIS                 
#FUSES NoLPT1OSC                  //Timer1 configured for low-power operation
#FUSES T1DIG                 
#FUSES MSSPMSK7             
#FUSES RTCOSC_T1             
#FUSES DSWDTOSC_INT         
#FUSES NOCPUDIV

#use delay(clock=12M)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,errors)
#use rtos(timer=0,minor_cycle=20ms)

time_t tDate_all;

#TASK(rate=1s,max=20ms) //,queue=5)
void flash_led()
{
   output_toggle(PIN_C5);
}

#TASK(rate=2s,max=20ms) //,queue=5)
void flash_led2()
{
   output_toggle(PIN_C4);
}

#TASK(rate=3s,max=20ms) //,queue=5)
void flash_led3()
{
   output_toggle(PIN_D3);//31771);
}

#TASK(rate=1s,max=20ms) //,queue=5)
void print1_1()
{
  rtc_read(&tDate_all);
  printf("HOla: %2u/%2u/%2u ** %2u:%2u:%2u\n\r",tDate_all.tm_mday,tDate_all.tm_mon,tDate_all.tm_year,tDate_all.tm_hour,tDate_all.tm_min,tDate_all.tm_sec);
}

#int_RTC
void RTC_isr(void)
{
   output_toggle(PIN_D2);
}

main()
{
   time_t tWriteTime;
   time_t tAlarmTime;
   
   tWriteTime.tm_year = 10;
   tWriteTime.tm_mon  = 6;
   tWriteTime.tm_mday = 19;
   tWriteTime.tm_wday = 6;
   tWriteTime.tm_hour = 23;
   tWriteTime.tm_min  = 58;
   tWriteTime.tm_sec  = 0;

   tAlarmTime.tm_year = 9;
   tAlarmTime.tm_mon  = 11;
   tAlarmTime.tm_mday = 24;
   tAlarmTime.tm_wday = 2;
   tAlarmTime.tm_hour = 16;
   tAlarmTime.tm_min  = 0;
   tAlarmTime.tm_sec  = 5;
 
   setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2|0X08);//0X08 enables timer1, it seems not to be considered  in setup_timer_1
   setup_rtc(RTC_ENABLE | RTC_OUTPUT_SECONDS, 0x00);
  // setup_rtc_alarm(RTC_ALARM_ENABLE,RTC_ALARM_SECOND, 0xff);

   rtc_write(&tWriteTime);
   //rtc_alarm_write(&tAlarmTime);
   //enable_interrupts(int_rtc);
   //enable_interrupts(global);

    while(1)
    {
       rtos_run();
    }   

}


The lst file show the next code:
Code:
....................    rtc_write(&tWriteTime);
0336:  MOVLB  F
0338:  MOVLW  55
033A:  MOVWF  FA7
033C:  MOVLW  AA
033E:  MOVWF  FA7
0340:  BSF    x3F.5
0342:  BSF    x3F.0
0344:  BSF    x3F.1
0346:  CLRF   FEA
0348:  MOVLW  3F
034A:  MOVWF  FE9
034C:  MOVLW  04
034E:  MOVWF  01
0350:  MOVF   FEE,W
0352:  MOVLB  0
0354:  RCALL  0298
0356:  MOVWF  F98
0358:  MOVF   FEE,W
035A:  RCALL  0298
035C:  MOVWF  F99
035E:  DECFSZ 01,F
0360:  BRA    0364
0362:  BRA    0368
0364:  MOVLB  F
0366:  BRA    0350
0368:  MOVLB  F
036A:  BCF    x3F.5

and I'm trying to understand that code, just that the label 0298 is not in lst file Confused, the code around that label is:
Code:

.................... #int_RTC
.................... void RTC_isr(void)
.................... {
....................    output_toggle(PIN_D2);
028E:  BCF    F95.2
0290:  BTG    F8C.2
.................... }
.................... 
0292:  BCF    FA4.0
0294:  GOTO   0058
.................... main()
.................... {
*
02BA:  CLRF   FF8
02BC:  BCF    FD0.7
02BE:  BSF    08.7
02C0:  CLRF   FEA
02C2:  CLRF   FE9
02C4:  BCF    F7E.3
02C6:  MOVLW  4D
02C8:  MOVWF  FB0
02CA:  MOVLW  A6
02CC:  MOVWF  FAD
02CE:  MOVLW  90
02D0:  MOVWF  FAC
02D2:  MOVLW  FF
02D4:  MOVLB  F
02D6:  MOVWF  x48
02D8:  BCF    FC2.6
02DA:  BCF    FC2.7
02DC:  MOVWF  x49
02DE:  MOVLW  07
02E0:  MOVWF  FB4
02E2:  CLRF   18
....................    time_t tWriteTime;


I hope someone can help me with that. I appreciate it.

Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jun 22, 2010 11:15 am     Reply with quote

It could be that it's not showing the CCS library code. To have the .LST
file show that code, you need to comment out the #nolist statement in
the 18F46J11.h file, as shown below in bold:
Quote:

//////// Standard Header file for the PIC18F46J11 device ////////////////
#device PIC18F46J11
// #nolist

Then re-compile and check the .LST file.
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