这是我根据以前的帖子写的一段程序,但就是一直读不到数据,但程序已经进ram了~~
/* Including used modules for compiling procedure */
#include "Cpu.h"
#include "Bit1.h"
#include "AS1.h"
/* Include shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "string.h"
void delay (unsigned int delay_time);
void EraseFlash();
void WriteFlash();
void Ram_EraseFlash();
void Ram_WriteFlash();
void move(void(*p)(),int size);
void main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
__DI();
Ram_EraseFlash();
Ram_WriteFlash();
/* Write your code here */
/* For example: for(;;) { } */
for(;;)
{
unsigned int result1,result2;
result1=*((volatile unsigned char *)(0xfd00));
result2=*((volatile unsigned char *)(0xfd01));
AS1_SendChar(result1);//串口发送数据
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
//延时程序 delay_time=1000-->13ms
// delay_time=200-->2.7ms
// delay_time=100-->1.3ms
// delay_time=50-->700us
// delay_time=20-->300us
// delay_time=10-->160us
// delay_time=5-->100us
// delay_time=2-->60us
// delay_time=1-->40us
void delay (unsigned int delay_time)
{
unsigned int i=0;
for (i=0; i < delay_time; i++)
{
}