首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

程序解释

程序解释

#include "IFsh1.h"
#include "BTN1.h"
#include "Inhr1.h"
#include "AS1.h"
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "Events.h"
#include "Cpu.h"


/* Global variables */
volatile word SR_lock=0; /* Lock */
volatile word SR_reg; /* Current value of the SR register */

/*
** ===================================================================
** Method : Cpu_Interrupt (bean 56F807)
**
** Description :
** This method is internal. It is used by Processor Expert
** only.
** ===================================================================
*/
#pragma interrupt
void Cpu_Interrupt(void)
{
asm(DEBUG); /* Halt the core and placing it in the debug processing state */
}

/*
** ===================================================================
** Method : Cpu_DisableInt (bean 56F807)
**
** Description :
** Disables all maskable interrupts
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
/*
void Cpu_DisableInt(void)

** This method is implemented as macro in the header module. **
*/

/*
** ===================================================================
** Method : Cpu_EnableInt (bean 56F807)
**
** Description :
** Enables all maskable interrupts
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
/*
void Cpu_EnableInt(void)

** This method is implemented as macro in the header module. **
*/

/*
** ===================================================================
** Method : Cpu_SetStopMode (bean 56F807)
**
** Description :
** Sets low power mode - Stop mode.
** For more information about the stop mode see this CPU
** documentation.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
/*
void Cpu_SetStopMode(void)

** This method is implemented as macro in the header module. **
*/

/*
** ===================================================================
** Method : Cpu_SetWaitMode (bean 56F807)
**
** Description :
** Sets low power mode - Wait mode.
** For more information about the wait mode see this CPU
** documentation.
** Release from wait mode: Reset or interrupt
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
/*
void Cpu_SetWaitMode(void)

** This method is implemented as macro in the header module. **
*/

/*
** ===================================================================
** Method : Cpu_SetDataMode (bean 56F807)
**
** Description :
** Sets the Data memory map to use either internal &
** external resources or external resources only.
** Parameters :
** NAME - DESCRIPTION
** Mode - Data memory access mode.
** Possible modes:
** INT_EXT_MODE - use internal & external
** resources
** EXT_MODE - use external resources only
** Returns : Nothing
** ===================================================================
*/
void Cpu_SetDataMode(byte Mode)
{
if (Mode == INT_EXT_MODE)
asm { bfclr #0x0008,OMR } /* Set internal and external data memory mode */
else
asm { bfset #0x0008,OMR } /* Set external data memory mode */
}

/*
** ===================================================================
** Method : Cpu_GetSpeedMode (bean 56F807)
**
** Description :
** Gets current speed mode
** Parameters : None
** Returns :
** --- - Speed mode (HIGH_SPEED, LOW_SPEED,
** SLOW_SPEED)
** ===================================================================
*/
byte Cpu_GetSpeedMode(void)
{
return HIGH_SPEED; /* Result the actual cpu mode - high speed mode*/
}

/*
** ===================================================================
** Method : _EntryPoint (bean 56F807)
**
** Description :
** This method is internal. It is used by Processor Expert
** only.
** ===================================================================
*/
extern void init_56800_(void); /* Forward declaration of external startup function declared in startup file */

/*** !!! Here you can place your own code using property "User data declarations" on the build options tab. !!! ***/

void _EntryPoint(void)
{

/*** !!! Here you can place your own code before PE initialization using property "User code before PE initialization" on the build options tab. !!! ***/

/*** ### 56F807 "Cpu" init code ... ***/
/*** PE initialization code after reset ***/
/* System clock initialization */
setReg(PLLCR, (PLLCR_LCKON_MASK | PLLCR_ZSRC0_MASK)); /* Enable PLL, LCKON and select clock source from prescaler */
/* CLKOSR: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,CLKOSEL=0 */
setReg16(CLKOSR, 0); /* CLKO = ZCLOCK */
/* PLLDB: LORTP=2,PLLCOD=0,PLLCID=1,??=0,PLLDB=39 */
setReg16(PLLDB, 8487); /* Set the clock prescalers */
while(!getRegBit(PLLSR, LCK0)){} /* Wait for PLL lock */
setReg(PLLCR, (PLLCR_LCKON_MASK | PLLCR_ZSRC1_MASK)); /* Select clock source from postscaler */
/* External bus initialization */
/* BCR: ??=0,??=0,??=0,??=0,??=0,??=0,DRV=0,??=0,WSX=0,WSP=0 */
setReg16(BCR, 0); /* Bus control register */
/*** End of PE initialization code after reset ***/

/*** !!! Here you can place your own code after PE initialization using property "User code after PE initialization" on the build options tab. !!! ***/

asm(JMP init_56800_); /* Jump to C startup code */
}

/*
** ===================================================================
** Method : PE_low_level_init (bean 56F807)
**
** Description :
** This method is internal. It is used by Processor Expert
** only.
** ===================================================================
*/
void PE_low_level_init(void)
{
/* Common initialization of the CPU registers */
/* IPR: CH3=1,IAL1=1,IAINV=0 */
clrSetReg16Bits(IPR, 1, 4100);
/* GPR3: PLR12=4 */
clrSetReg16Bits(GPR3, 3, 4);
/* GPIO_E_PER: PE|=3 */
setReg16Bits(GPIO_E_PER, 3);
/* GPR13: PLR53=4,PLR52=4 */
clrSetReg16Bits(GPR13, 51, 68);
/* GPR12: PLR51=4,PLR50=4 */
clrSetReg16Bits(GPR12, 13056, 17408);
IFsh1_Init();
/* ### External interrupt "Inhr1" init code ... */
setRegBit(IPR,IAL0); /* Enable interrupt "INT_IRQA" */
/* ### Button "BTN1" init code ... */
BTN1_Init();
/* ### Asynchro serial "AS1" init code ... */
AS1_Init();
__EI(); /* Enable interrupts */
}

/* END Cpu. */

/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 2.96 [03.65]
** for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/

void Cpu_Interrupt(void)定义的应该是bean里面的吧,但是我始终在PE中CPU的下拉菜单项里面找不到Cpu_Interrupt函数啊,为什么呢?

函数说明里不是说了么,这个是PE的内部函数,不是提供给application的接口函数

** ===================================================================
** Method : Cpu_Interrupt (bean 56F807)
**
** Description :
** This method is internal. It is used by Processor Expert
** only.
** ===================================================================

只有提供给用户调用的接口函数才会出现在CPU bean下面

请问一下,我买的DSP56F807EVM,让他给进行技术支持,但是他说:"很抱歉,SDK移植到PE的工作我们还没有做过,一般用户都是直接使用PE开发或全部自己写程序开发的,由于SDK属于很早就停止供应的软件产品我们也无法提供更多的支持,如果您需要更深入的软件支持请直接发送邮件到CW软件供应商,因为这个软件应该是付费才能够提供深入的开发和技术支持的。"为什么会这样呢?

Fiona.Kuang能不能QQ直接交流一下,毕竟现在搞Freescale  DSP的人不多,我们学院也没有人搞这个了,还真希望能和你多交流交流,谢谢你给我解答我的疑问.
我的QQ:95406648,我是一名在校研究生,谢谢!
QUOTE:
以下是引用xiaoniao在2008-12-21 15:49:00的发言:

请问一下,我买的DSP56F807EVM,让他给进行技术支持,但是他说:"很抱歉,SDK移植到PE的工作我们还没有做过,一般用户都是直接使用PE开发或全部自己写程序开发的,由于SDK属于很早就停止供应的软件产品我们也无法提供更多的支持,如果您需要更深入的软件支持请直接发送邮件到CW软件供应商,因为这个软件应该是付费才能够提供深入的开发和技术支持的。"为什么会这样呢?

你联系的哪里?“CW软件供应商”就是freescale啊

[此贴子已经被作者于2008-12-22 15:19:33编辑过]

如果客户原来的项目是用SDK做的,是可以移植到新版本CW上的,这个过程很容易。其实麻烦的是怕不同版本的编译器可能引入一些麻烦。但是理论上来讲,SDK的移植是不会有太大问题的。

如果是新的开发,就不要用SDK了。

我很愿意帮助你,而且会尽最大的努力。但是我时间有限,一天最多过来看一两次,工作了的人没那么多时间喽。你可以短给我你的其他联系方式,我很久不用qq了

[此贴子已经被作者于2008-12-22 15:13:36编辑过]

因为我不知道你用什么方式进行联系,我这边什么方式都可以,如果可以的话,你告诉我你的联系方式,无论是MSN还是其他什么的.我的EMAIL:yugangeducn@163.com,我的手机:13770312925,你可以随时和我联系,本人姓喻,谢谢!

直接用EMAIL也可以,或者其他方式也可以,敬请不吝赐教,谢谢!

在这个网站上发了两条信息给你。sorry,没有发e-mail

谢谢,但是我再次发到support.asia@freescale.com,仍然没有收到编号,我用的是附件里面加载word的方式提问的.

返回列表