4876|8

6107

帖子

4

TA的资源

版主

楼主
 

MB9B506之CAN初探笔记 [复制链接]

MB9B506CAN初探笔记

FM3 32-BIT MICROCONTROLLER MB9Axxx / MB9Bxxx SeriesPERIPHERAL MANUAL

CAN Prescaler CAN分频器

哪里来的:   For PLL: PLL output

          For others (including Standby in Figure 1-1): Base clock (HCLK)

到哪里去? 送给CAN做为时钟。注意:有个PLL时钟允许位SCM_CTL.PLLE   

寄存器为CANPRE

CAN Controller CAN控制器

1 特征:

1下载附件  保存到相册

2012-6-26 22:52 上传

1),CAN control unit CAN控制单元

Controls the CAN protocol and the serial registers for serial/parallel conversion to transfer send/received messages.

2),Message RAM 消息内存

Stores message objects

3),Registers 寄存器

All registers used by CAN.

4),Message handler 消息处理

Controls the message RAM and CAN control unit.

5),CPU interface CPU接口

Controls the internal bus interface.

 

 

3  CAN控制操作

功能:

Message objects 消息对象

  Message transmission 消息传输

  Message reception 消息接收

  FIFO buffer function FIFO缓冲功能

  Interrupt function 中断功能

  Bit timing 为时序

  Test mode 测试模式

  Software initialization 软件初始化

3.1 消息对象

Message objects 消息对象

The configuration of message objects in the message RAM (excluding the MsgVal, NewDat, IntPnd, and TxRqst bits) is not initialized by a hardware reset. Initialize the message objects by the CPU, or set the MsgVal bit to disable (MsgVal = "0"). Configure the CAN Bit Timing Register while the Init bit in the CAN Control Register is "1".

消息内存中的消息对象的配置不是由硬件复位完成,还需要CPU初始化。或设置MsgVal位为不可用(为0)。当控制寄存器的Inir位为1时配置位速率时间。

 

A message object must be configured by programming message interface registers (the IFx Mask Register, IFx Arbitration Register, IFx Message Control Register, and IFx Data Register), and then writing a message number to the corresponding IFx Command Request Register. By writing the message number, the interface register data will be transferred to the addressed message object.

消息对象必须用(the IFx Mask Register, IFx Arbitration Register, IFx Message Control Register, and IFx Data Register)可编程接口寄存器配置.并写一个消息号到相应的IFx Command Request Register.通过写消息号,接口寄存器数据将传送到编址的消息对象。

 

 

When the Init bit in the CAN Control Register is cleared to "0", the CAN controller starts operation. The received data that have passed acceptance filtering are stored into the message RAM. Messages with pending transmission requests are transferred from the message RAM to the shift register in the CAN controller, and then sent to the CAN bus.

CAN控制寄存器的Init位清零后,CAN控制器开始启动了。接收数据经过过滤后存储到消息内存。请求发送的消息从消息内存传送到CAN控制器的移位寄存器,发送到CAN总线。

 

The CPU reads the received messages and updates outgoing messages via message interface registers. The CPU is interrupted according to the configuration of the CAN Control Register and IFx Message Control Register (message object).

CPU接收消息和发送消息经过消息接口寄存器。根据CAN Control Register IFx Message Control Register (message object).的配置产生相应中断

 

[ 本帖最后由 damiaa 于 2012-6-26 23:14 编辑 ]

最新回复

进一步啊  详情 回复 发表于 2012-7-25 15:35
点赞 关注
 

回复
举报

6107

帖子

4

TA的资源

版主

沙发
 

后面的过两天继续

[ 本帖最后由 damiaa 于 2012-6-26 22:55 编辑 ]
 
 

回复

6107

帖子

4

TA的资源

版主

板凳
 

 

[ 本帖最后由 damiaa 于 2012-6-26 22:47 编辑 ]
 
 
 

回复

2万

帖子

74

TA的资源

管理员

4
 
加油 哦
加EE小助手好友,
入技术交流群
EE服务号
精彩活动e手掌握
EE订阅号
热门资讯e网打尽
聚焦汽车电子软硬件开发
认真关注技术本身
个人签名

加油!在电子行业默默贡献自己的力量!:)

 
 
 

回复

2856

帖子

260

TA的资源

五彩晶圆(高级)

5
 
期待中
 
 
 

回复

1万

帖子

25

TA的资源

裸片初长成(高级)

6
 
加油
 
 
 

回复

6107

帖子

4

TA的资源

版主

7
 

Data transfer from/to message RAM 和消息内存直接的数据传输

When data transfer starts between the message interface registers and message RAM, the Busy bit in the IFx Command Request Register is set to "1". After the transfer has finished, the Busy bit is cleared to "0".(See Figure 3-1)

 

当数据开始在消息接口寄存器和消息内存直接传送,IFx Command Request Register的Busy位被设置为1,传输完成后被清零(见图3-1)

 

The IFx Command Register selects whether to transfer complete data or only partial data of one message object. The structure of the message RAM does not allow the writing of single bits/bytes of one message object. The complete data of one message object is always written to the message RAM. Therefore, the data from the message interface registers to the message RAM is transferred in a read-modify-write cycle.

 

The IFx Command Register选择是传送全部数据还是部分数据。消息内存结构不允许写消息对象的单个位/字节,从消息接口寄存器到消息内存的数据传送是在一个读改写周期进行的。

3.2. Message transmission 消息传送 Sending messages

操作:If there is no data transfer between the message interface registers and message RAM, the MsgVal bit in the CAN Message Valid Register and the TxRqst bit in the CAN Transmit Request Register are evaluated. A valid message object with the highest priority of pending transmission requests is transferred to the shift register for transmission. Then the NewDat bit of the message object is reset to "0".

 

如果没有数据在消息接口和消息内存直接传送,the CAN Message Valid Register 中的MsgVal位the CAN Transmit Request Register中的TxRqst位被评定(?)。一个有效的具有高优先级的传送请求的消息对象被传送到移位寄存器去传送。随后the message object 的NewDat位被清零。

 

结果:When the transmission has finished successfully, and if there is no new data in the message object (NewDat = "0"), the TxRqst bit is reset to "0". If TxIE is set to "1", then the IntPnd bit is set to "1" after a successful transmission. If the CAN controller lost the arbitration on the CAN bus, or if an error occurred during transmission, the message is resent immediately when the CAN bus becomes idle.

当传送完成,并且消息对象中没有新的数据(NewDat = "0"), the TxRqst bit复位到0If TxIE设置为"1",然后成功传送后IntPnd位设置为1,如果CAN控制器失去总线仲裁,或传送发生错误,消息会在总线闲置时重发。

 

Transmission priority 传输优先级

The transmission priority of the message objects is determined by the message number. Message object 1 has the highest priority, while message object 32 (the largest number of the installed message objects) has the lowest priority. If two or more transmission requests are pending, they are transferred in the order of corresponding message number from smallest to largest.

消息 对象的传输优先级是由消息号决定的。消息对象1有最高的优先级,而消息对象32(消息对象的最大号)有最低优先级。如果两个或以上的传输请求产生,他们按消息号的由小到大的顺序传输这些消息对象。

<Notes>

In one of the following conditions, the messages may not be sent until any of the events described below occurs.在下列条件,消息将等待描述的事件发送才发送。

Conditions :

(1) A message buffer with the lowest priority is used for transmission.

一个最低优先级的消息缓冲用于传输

(2) The TxRqst bit was previously set to "1", but is set to "0" to abort transmission.

   TXRqst被提前设置为1,但被设置为0去终止传输。

(3) The TxRqst bit is set to "1" again at the timing of (2).

TXRqst被在(2)中再次设置为1

Events :

- A valid message flows on the CAN bus.一个有效的消息出现在总线

- A transmission request is issued to another message buffer. 一个传输请求发到另一个消息缓冲

- CAN is initialized by the Init bit. CAN被在Init位设置时初始化。

下载附件  保存到相册

2012-7-7 20:40 上传

 

The IFx Arbitration Register (ID28-0 and Xtd bit), given by the application, defines the ID and the type of the outgoing message. ID号和扩展帧标准帧类型选择由应用程序给出,由它定义ID号和输出消息的类型

If the standard frame (11-bit ID) Is set, then ID28 to ID18 are used, and ID17 to ID0 are ignored. If the

extended frame (29-bit ID) is set, then ID28 to ID0 are used.

如果标准帧(11-bit ID)被设置,将使用到ID28 to ID18ID17 to ID0不用,如果扩展帧(29-bit ID)被设置,ID28 to ID0 被使用。

If TxIE bit is set to "1", then the IntPnd bit is set to "1" after a successful transmission of the message

object.

如果TxIE位设置1,然后成功传送一个消息对象后IntPnd位设置1

If the RmtEn bit is set to "1", the TxRqst bit is set to "1" after receiving the corresponding remote frame, and a data frame is sent automatically.

如果设置了RmtEn bit1远程帧接收到后会产生TxRqst bit1,并自动发送一个数据帧。

 

 

[ 本帖最后由 damiaa 于 2012-7-8 10:40 编辑 ]
 
 
 

回复

119

帖子

0

TA的资源

一粒金砂(高级)

8
 
很认真耶
 
 
 

回复

119

帖子

0

TA的资源

一粒金砂(高级)

9
 
进一步啊
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/7 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表