PIC24F_EDS_C_Code_Example_V1

所属分类:其他
开发工具:C/C++
文件大小:13KB
下载次数:2
上传日期:2019-01-21 16:51:26
上 传 者lzy89c55
说明:  PIC24系列 参考代码 ,在这个例程里,EDS表示变量的语法显示出来。2个例子内外存储器连接到增强型并口上。
(PIC24 mcu refence code. Code Example Description: In this example, the syntax to declare variables in EDS are shown. Both examples for the internal and external memory (memory hooked up to Enhanced Parallel Master Port (EPMP)) are given.)

文件列表:
MainEDSExample.h (5554, 2011-01-24)
PIC24F EDS C Code Example V1.mcp (1780, 2011-01-24)
PIC24F EDS C Code Example V1.mcw (23552, 2011-01-24)
EDSExample.c (7267, 2011-01-24)
MainEDSExample.c (13107, 2011-01-24)

Readme File for Code Example: C Code Example for Extended Data Space (EDS) ------------------------------------------- This file contains the following sections: 1. Code Example Description 2. Tools used in the example 3. Hardware used in the example 4. Configuring the hardware for the project 5. Folder Contents 6. Reconfiguring the project for a different PIC24F device 7. Known Issues 8. Revision History 1. Code Example Description: ---------------------------- In this example, the syntax to declare variables in EDS are shown. Both examples for the internal and external memory (memory hooked up to Enhanced Parallel Master Port (EPMP)) are given. C30 Compiler recommends the use of -mlarge-arrays compile setting on the file that contains arrays larger than 32K. Refer to the MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs User’s Guide (as of this writing the document version is DS51284J) Section 4.15 - Using Large Arrays for details. The project build option also has memory options set to use large models. The file EDSExample.c contains all the example code on large EDS arrays. The build option of this file is set to -mlarge-arrays. This file is the only one set so the whole program will not suffer on speed and code size degradation when EDS addressing is used (See the C30 User's Manual section mentioned above). There are two main functions. TestInternalEDS() - this shows how variables in internal EDS are accessed TestExternalEDS() - this shows how variables in external EDS are accessed The third function (only for PIC24FJ256DA210) InitializeEPMP() - initializes the EPMP in PIC24FJ256DA210 Development Board. The two test functions writes random data using random number generator (rand()). The random function is seeded using the same seed value to regenerate the same sequence of random data to test if indeed the memory locations are accessed correctly. Since the hardware (Explorer 16 or PIC24FJ256DA210 Developnment Board) where the code is run has available LEDs, these are used as a status of the test. 2. Tools used in the example: ---------------------------- a. MPLAB IDE Version 8.60 b. MPLAB C30 Version 3.25 3. Hardware used in the example: -------------------------------- a. PIC24FJ256DA210 Development Board (P/N DM240312) b. Explorer 16 Demo board with PIC24FJ256GB210 controller (to test internal EDS only) (P/N DM240001) c. PIC24FJ256GB210 Plug In Module (PIM) for Explorer 16 (P/N MA240021) 4. Configuring the hardware for the project: -------------------------------------------- a. PIC24FJ256DA210 Development Board - the on-board SRAM and LEDS are used in the board. The three LEDs of the board are used as a status of the test while the SRAM must be configured to be accessed properly. Set the following jumpers to the correct positions: JP11 : 2-3 JP13 : PAD1-RG8 JP14 : PAD2-RE9 JP15 : PAD3-RB5 b. Explorer 16 Demo Board - No special settings are required. c. PIC24FJ256GB210 Plug In Module (PIM) - the jumpers on the PIM do not affect the execution of the program. It can be set to any position. 5. Folder Contents: ------------------- This folder contains the following files: a. PIC24F EDS C Code Example V1.mcp - the project file for this code example. b. EDSExample.c - the c file that contains all the EDS variable declaration and example code. c. MainEDSExample.c(h) - these are the main c and h files d. ReadMe.txt - this read me file 6. Reconfiguring the project for a different PIC24F device: ------------------------------------------------------------- The Project/Workspace can be easily reconfigured for any PIC24F device. Please use the following general guidelines: a. Change device selection within MPLABIDE to a PIC24F device of your choice by using the following menu option: MPLAB IDE>>Configure>>Select Device Make sure that the device selected supports EDS. b. Provide the correct device linker script and header file for your device. Device linker scripts and header files are available in your MPLAB C30 installation folder under: Device Linker Script- YourDrive:>Program Files\Microchip\MPLAB C30\support\gld Device C Header file- YourDrive:>Program Files\Microchip\MPLAB C30\support\h Device ASM Include file- YourDrive:>Program Files\Microchip\MPLAB C30\support\inc c. Provide the appropriate path to your MPLAB C30 support file locations using the menu option: MPLAB IDE>>Project>>Build Options>>Project d. Chose the development board applicable to your device. Some options are provided below: e. Re-build the MPLAB?project using the menu option: MPLAB IDE>>Project>>Build All f. Download the hex file into the device and run. 7. Known Issues: ---------------- a. MPLAB IDE Version 8.60 - Watch window is not able to show large arrays. To view the contents of the arrays use the "File Registers" window by finding the address of the array used. b. EDS variables in C30 cannot be declared in the heap. Due to this limitation, the variables are declared as global variables. 8. Revision History : --------------------- Version # Date Comments Version 1 1.11.11 Initial Release of the Code Example

近期下载者

相关文件


收藏者