田舎の組み込みプログラマーがわざわざ趣味でも色々開発してみようとあがく様を綴るブログです。
DMM.makeのクリエイターズマーケットに出品しています。

R8CのCANモジュールを読み解く(1)2015年09月04日

記憶が追いつかない

マイコンのデータシートを読み解こうとしても読んだ端から忘れてしまってとても理解できません。
当たり前のようにビット名を列挙したりしていますが、一つの解説文に複数のレジスタのビットがあったりして理解よりも想起のように意識が向きがちです。

そんなわけで、R8CのCANモジュールについてもちょっとまとめてみました。

R8C CANモジュールのメールボックスとフィルタ

このメールボックスの構成がデータシートの書き方では頭に入らなかったんですが、これなら分かりやすいと思います。

怒濤のメッセージから必要なものだけキャッチ

CANバスには大量のメッセージが流れていて、これをアプリケーションの処理だけで抜き出すのは大変そうですが、幸いR8CのCANモジュールにはメッセージフィルタがあってソフトの負担を軽減してくれます。

が、やはりデータシートが難解で自分の頭の負担が大きかったので図示してみました。

アクセプタンスフィルタとかいうやつ

R8C/3xWのCANモジュールには16個のメールボックスがあり、受信したいCANメッセージのIDをメールボックスにセットしておくとそのメッセージがバス上に流れた時に取り込んでくれるのが基本です。

しかし、それだけだと1つのメールボックスで1種類のメッセージしか取り込めませんので、範囲指定できるようにする仕組みがアクセプタンスフィルタです。

マスクレジスタに受信IDとメールボックスにセットしたIDとの一致させるビット/違っていてもかまわないビットの情報をセットすることで範囲指定ができるようになっています。
メールボックスが16個あるのに対してマスクレジスタが4つしかないので使い方がなかなか理解できませんでしたが、試しにOBDメッセージの受信について考えてみたら分かったような気がします。

といっても、R8CのCANモジュールのメッセージ選択方法は他にもあり、それはこれから勉強するところです。

コメント

_ Nail Fungus Infection ― 2016年02月26日 06時07分

You really make it seem so easy with your presentation but I
find this matter to be actually something which I think I
would never understand. It seems too complicated and extremely broad for me.
I'm looking forward for your next post, I'll try to get the hang
of it!

_ Cold Foot Complaints ― 2016年02月28日 16時13分

If some one needs to be updated with latest technologies then he
must be pay a quick visit this web site and be up to date daily.

_ Pump Bump ― 2016年02月28日 20時49分

Everything is very open with a precise description of the issues.
It was truly informative. Your website is useful. Thanks for sharing!

_ Children Feet ― 2016年02月29日 01時46分

Do you have a spam problem on this website; I also am a blogger, and I was wanting to know your situation; many of us have
created some nice procedures and we are looking to trade strategies
with others, why not shoot me an email if interested.

_ erythromelalgia ― 2016年03月03日 20時22分

Hey there! This post could not be written any better! Reading this post reminds me of my old room
mate! He always kept chatting about this. I will forward this post to him.

Pretty sure he will have a good read. Thank
you for sharing!

_ Leslee ― 2016年03月08日 20時58分

Hello just wanted to give you a quick heads up and let you know a few of
the pictures aren't loading correctly. I'm not
sure why but I think its a linking issue. I've tried it in two different browsers and both show the same results.

_ Toes Problems Symptoms ― 2016年03月10日 22時20分

Hi there everyone, it's my first pay a quick visit at this web page,
and piece of writing is really fruitful in support of me, keep up posting such articles.

_ Smith Sorenson Nutraceuticals Garcinia Cambogia ― 2016年04月29日 06時01分

I do not even know the way I stopped up here, however I assumed this publish was once
good. I do not understand who you might be but certainly you are
going to a well-known blogger in case you are not already.
Cheers!

_ Garcinia Cambogia 50 Hca Work ― 2016年05月16日 17時09分

Excellent beat ! I would like to apprentice while you amend your web site,
how could i subscribe for a blog web site? The account
aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea

_ great height ― 2016年06月02日 13時13分

I blog frequently and I seriously thank you for your information. This article has truly peaked my interest.
I'm going to take a note of your website and keep checking for new information about once per
week. I subscribed to your Feed too.

※コメントの受付件数を超えているため、この記事にコメントすることができません。

トラックバック

このエントリのトラックバックURL: http://trident.asablo.jp/blog/2015/09/04/7777342/tb