• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 有關於compier中斷問題
#7
版主
版主


查看用戶資訊
問題找到了是 RAM Bank 設定的問題。你可以將 LKR 檔裡將數個 BANK 合併成一個大區塊,如下所示:
ACCESSBANK NAME=accessram START=0x0 END=0x5F
DATABANK NAME=gpr0 START=0x60 END=0xFF
DATABANK NAME=gpr12345 START=0x100 END=0x5FF
//DATABANK NAME=gpr2 START=0x200 END=0x2FF
//DATABANK NAME=gpr3 START=0x300 END=0x3FF
//DATABANK NAME=gpr4 START=0x400 END=0x4FF
//DATABANK NAME=gpr5 START=0x500 END=0x5FF

當然最好的方式還是將你的陣列及變數好好的規劃一下,使用 #pragme udata abc=0x100 強定RAM BANK的方式將他規化成小於 256 bytes 的區塊。

發表於: 2007/2/15 15:24
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有關於compier中斷問題
#6
版主
版主


查看用戶資訊

發表於: 2007/2/15 11:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有關於compier中斷問題
#5
新會員
新會員


查看用戶資訊
請問一下如何將檔案傳給您
是透過mail還是?

發表於: 2007/2/15 10:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有關於compier中斷問題
#4
版主
版主


查看用戶資訊
加個 prototype 的宣告:
void isr_high_direct(void) ;

要是還有錯就請將整個project壓成zip 檔後傳過來。

發表於: 2007/2/15 10:24
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有關於compier中斷問題
#3
新會員
新會員


查看用戶資訊
#include <p18f6620.h>
#include <V160pin_define.h>
#include <usart.h>
#include "main.h"
#include "Include_Prototype.h"

void isr_high(void);

//************************************************
//*       #pragma Interrupt Declarations         *
//*                                                 *
//* Function: isr_high_direct                    *
//*   - Direct execution to the actual           *
//*     high-priority interrupt code.            *
//************************************************
#pragma code isrhighcode = 0x0008

void isr_high_direct(void)    
{                                  
     
_asm                     //begin in-line assembly
     
goto isr_high                //go to isr_high function
     
_endasm                     //end in-line assembly
}
#pragma code

//************************************************
//* Function: isr_high(void)                     *     
//*   High priority interrupt will               *
//*   - Received a serial data from RS-232       *
//*     Save the received data to buffer Rec_Data*                  
//************************************************
#pragma interrupt isr_high 

void isr_high(void)
{
    
int i,j;
    
int nHour;
    
char cTmp =  0x00;
    
int UART_Index;
  
      
cTmp Read2USART();
      if (
cTmp == '$'
          
UART_Index 0;

      
g_caGprmcData[UART_Index] = cTmp;
      
UART_Index UART_Index 1;

      if ((
g_caGprmcData[0] == '$') &&(g_caGprmcData[1] == 'G')
          && (
g_caGprmcData[2] == 'P') && (g_caGprmcData[3] == 'R')
          && (
g_caGprmcData[4] == 'M') && (g_caGprmcData[5] == 'C')
          && (
g_caGprmcData[UART_Index 1] == 0x0A)
          && (
g_caGprmcData[UART_Index 2] == 0x0D))
      {
         
GpsConveter(g_caGprmcData);
 
        if(
GpsCheckFunction1(66g_caGprmcData))
        {
            
g_bHasValidGpsData TRUE//資料格式無誤
        
}
        else
        {
            for (
066i++)
                return; 
//資料有問題, 則離開.
        
}

        for (
080j++)
        {
            
g_caGPS_Data[j] = g_caGprmcData[j];
        }

        if (
g_caGprmcData[14] == 'V') {
            
g_bGPSValid FALSE;
            
GpsErrLed 1;           
        }
        else if (
g_caGprmcData[14] == 'A')
          {
            
g_bGPSValid TRUE;
            
g_caFlagGPSRecINT TRUE;
            
GpsErrLed 0;

//修改校正時間
        
nHour = (g_caGprmcData[7] - 0x30) * 10 + (g_caGprmcData[8] - 0x30) + 8;
        
nHour nHour 24;                
        
g_caSystemTime[0] = nHour/10 0x30;
        
g_caSystemTime[1] = nHour%10 0x30;
         
g_caSystemTime[2] = g_caGprmcData[9];
        
g_caSystemTime[3] = g_caGprmcData[10];
        
g_caSystemTime[4] = g_caGprmcData[11];
        
g_caSystemTime[5] = g_caGprmcData[12];

        
g_caSystemDate[0] = g_caGprmcData[57];
        
g_caSystemDate[1] = g_caGprmcData[58];
        
g_caSystemDate[2] = g_caGprmcData[55];
        
g_caSystemDate[3] = g_caGprmcData[56];
        
g_caSystemDate[4] = g_caGprmcData[53];
        
g_caSystemDate[5] = g_caGprmcData[54];
                
        for(
i=i<i++)
        {
                    
        }
        for(
i=i<i++)
        {
                    
        }
         }

         if (
g_bGPSValid == FALSE)
            
g_caGPS_Data[14] = 'V';

         
UART_Index 0;
      } 
// end if gprmc
    //} // end if kbhit();
        
if (UART_Index 120
              
UART_Index 0;
}                                
#pragma code

發表於: 2007/2/15 10:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有關於compier中斷問題
#2
版主
版主


查看用戶資訊
可否將中斷的程式貼上來看一看,看起來像是中斷程式所給的空間不夠。

發表於: 2007/2/15 9:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


有關於compier中斷問題
#1
新會員
新會員


查看用戶資訊
請問一下,如果要使用USART傳輸,要使用中斷,結果當我設了相關的函式的時候,compiler會出現下列訊息

MPLINK 3.40, Linker
Copyright (c) 2003 Microchip Technology Inc.
Error - section '.udata_1interrupt.o' can not fit the section. Section '.udata_1interrupt.o' length=0x000002a6
Errors : 1


那我是應該要改哪裡的DATABANk?還是要修改哪裡才能把此問題修正

6620

MPLAB
感謝

發表於: 2007/2/15 9:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------