FastAVRはなかなか便利なんですが、結構バグがあるみたいです。ここでは見つけたバグをアップして行きます。私の使ってるFastAVRはVer. 4.1.3で最新版ではありません。最新版はなぜか私のコンピュータで動かなかったのでこれらのバグが直ってるのかわかりません。

なお、私は FastAVRのマニュアルをろくすっぽ読んで無いので以下の物はバグではなくFastAVRの仕様である可能性もあります。

それにしてもバグが多いですね。無料のデモ版なので我慢しながら、使いますが、とても金を取れる代物ではないですね。特にインデックスを使うとやたらにバグります。インデックス部分はアセンブラで書いた方が早いような気がします。

FastAVR is very handy to write calculation parts of the program, but has lot of bugs. In this page I will list up the bugs I found. I am using Fast AVR 4.1.3 and it is not the latest version. The latest version did not work on my computer and I do not know these bugs have been fixed on later versions.

Also I have not read the manual carefully. So some of below may be as language specification and not bugs.

Anyway once I used indexing I found so many bugs. The demonstration version is free. So I may use it. But I never pay any money for this kind of quality. Writing by assembler may be quicker for indexing.

Dim PW_grad_w As Integer
Dim PW_grad_db(4) As Integer

PW_grad_w=PW_grad_db(ix)

Assembler modification:

lsl r24  ; add this
rol r25
  ; add this
add xl, r24
adc xh, r25
ld zl,X+  ; add this
ld zh,X   ; add this

sts PW_grad_w,zl
sts PW_grad_w+1,zh  ; last line

Indexing of RAM memories “as integer” are not compiled properly. Instead “as word” and “as flash” are compiled properly.

By adding for lines as red letters the assembled code will work.

この場合正しくコンパイルされませんでした。配列がFlashの時はOK。WordでもOKでした。
対策は変数をWordとして宣言し、必要であれば後でIntegerに変換しています。

または、コンパイルされたアセンブラコードの最後のほうに赤字の4行を追加すればOKです。

Dim PW_grad_b(4) As byte
Dim PW_grad_i(4) As Integer

PW_grad_b(ix)=PW_grad_i(ix)

When a datum moved to a variable with different length, the indexing does not compiled properly.

lこの様に違う長さの変数のインデックスを使っての代入は不可。Byte側のインデックス計算が合わなくなる。右辺左辺とも同じ長さの変数にする事。

For ix=0 To num_channel-1

In “For” statement start and end numbers (red) must be constants. If variables are used the result is wrong.

赤字の部分はConstantで無ければいけない見たいです。変数にしたら正しくコンパイルされませんでした。

PWM_Mod(ix)=-work_w  ;Does not give minus

instead:

PWM_Mod(ix)=0-work_w

You cannot inverse the polarity by this expression. You must subtract from “0”.

この表現はだめです。マイナスになりません。

If (0-PW_nom_w)<work_w Then

Expressions in IF statements are not compiled correctly.

IF文の中の演算は正しく評価されません。


 

 
inserted by FC2 system