⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 PIC18fXX can源程序,回环控制的代码,
💻 TXT
字号:
Readme File for Code Example:

Transmitting the message and receiving it back in the Loopback mode 
----------------------------------------------------------------------------------------------------------------


This file contains the following sections:
1. Hardware Requirements
2. Code Example Description
3. Folder Contents
4. Suggested Development Resources
5. Reconfiguring the project for a different dsPIC30F device
6. Revision History


1. Hardware Requirement:
----------------------------

The following boards are used for developing this code example

dsPICDEMGP 1.1PLUS Board 

The device used is dsPIC30F6014A

MPLLAB ICD2 Debugger/Programmer is used for debugging and running this code example.




2. Code Example Description:
----------------------------------------------------------------------------------------------------------------
If the Loopback mode is activated, the module will connect the internal transmit signal to the internal receive
signal at the module boundary. The transmit and receive pins revert to their port I/O function.

In this code example we have initialized the outdata registers with some values and then after initializing
the CAN module for the loop back mode we have transmitted the same data on the Tx Line , The same data is 
received in the Rx line in the loopback mode and after receiving it in the Rx Buffer we compare it with the
values what we have transferred from the outdata register , If the values are same then we switch on the LED
on Port D which is there on the Development Board .

The same is done with CAN1 and CAN2


How to set up the board and view the working of the code 

Place the dsPIC30F6014A PIM in the dsPICDEM 1.1GP Board and connect it to the ICD2 .After loading the code 
in the device the running the device , all the four LED on the board should turn on .

You can also observe the working using the Debugger , See that when you place the breakpoint after the 
receiving the data you will get the same data in the receive registers that you transmitted from the 
outdata registers.These registers can be viewed in the watch window of MPLAB IDE.

How to Calculate the value to NTq ,BRP 

                   FTq= N*FBAUD
 FBAUD = 1 MBPS so we have to select value for FTq and N

                   BRP = (FCAN/(2*FTq))-1
FCAN = 30MHZ,Since BRP has to be a valid Integer for Maximum speed the value of FTq has to be 15MHz
so BRP becomes 0 

                  N=15MHz/1Mbps =15

Since the value of N can vary between 8-25 according to the CAN Protocol it will depend on the CAN
Speed on which you are operating the bus and your Processor Frequecny
So with 30MHz and 1Mbps you can have maximum value of N as 15 .


3. Folder Contents:
-------------------
This folder contains the following sub-folders:
a. C:\Program Files\Microchip\MPLAB C30\support\gld
        This folder will have the device GLD file, it is used for building the project. 
	This file was provided with the MPLAB

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -