投稿募集! スレッド一覧

スレッド作成 他のスレッドを探す

[PR]  グアム格安旅行 求人・転職 seo対策 CIA
teacup. ] [ 無料掲示板 ] [ プレミアム掲示板 ] [ teacup.コミュニティ ] [ ブログ ] [ チャット ]

新着順:4/87 記事一覧表示 | 《前のページ | 次のページ》

FJCニュ−ス9月号

 投稿者:ty  投稿日:2009年 8月29日(土)14時49分29秒
  通報
  FJCニュ−ス9月号
今月は16F627,628のアセンブラと書き込みについてです。
16f62xはピンは16F84と同じですが,16ビットタイマーや
コンパレータ、内部オシレータなどの機能もあります。
628は2Kのプログラムメモリーで、84の2倍。
I/Oも内部OSCだとRAが3ポート増。
16F84で、秋月PAのASMファイルを、移植
秋月PA用ヘッターファイル 16f6xx.hを作成
ターゲットは16C62でPAでアセンブルできます。
HEXファイルをROMライター
に読み込みますと、この方法で作成したものでは、
コンフィグレーションワードは正しく生成できませんので
手書きで修正します。
私は自作の16F8XX用ライターで、コンフィグレーションワード
の扱いをパソコンソフトの修正をしました。
移植には、RAMユーザーエリアを、0CHから20Hにして、
コンパレータを、使用しない設定を追加します。
        setb rp0
;clrb oscf ;osc int の設定時 37kHz
setb oscf ;osc int の設定時 4MHz
clrb por ;pow on reset
clrb bor ;boden on
clrb rp0

clr ra
mov cmcon,#7 ;ra I/O not use compareter
mov !ra,#11110001b ;8バイト設定

以下は 秋月PA用 インクルードファイル 16f6xx.h
です。
;-------------------------------------------------------

.nlist
.16c62
;
; PIC16F6XX Header file Vers.1.00
; Copyright (c) t.y
;

indirect equ 0
indf equ 0

rtcc equ 1 ; RTCC = TMR0 = 1
tmr0 equ 1
option equ 1 ; OPTION

ps0 equ 1.0
ps1 equ 1.1
ps2 equ 1.2
psa equ 1.3
t0se equ 1.4
t0cs equ 1.5
intedg equ 1.6
rbpu equ 1.7

pc equ 2 ; PC = PCL = 2
pcl equ 2

status equ 3 ; STATUS
c equ 3.0 ; carry/borrow flag
dc equ 3.1 ; digit carry/borrow flag
z equ 3.2 ; zero flag
pd equ 3.3 ; power down bit
to equ 3.4 ; time out bit
rp0 equ 3.5 ; page select
rp1 equ 3.6 ;
irp equ 3.7

fsr equ 4
porta equ 5
ra equ 5
trisa equ 5

portb equ 6
rb equ 6
trisb equ 6

pclath equ 0ah

intcon equ 0bh
rbif equ 0bh.0
intf equ 0bh.1
t0if equ 0bh.2
rbie equ 0bh.3
inte equ 0bh.4
t0ie equ 0bh.5
peie equ 0bh.6
gie equ 0bh.7

pir1 equ 0ch
tmr1if equ 0ch.0
tmr2if equ 0ch.1
ccp1if equ 0ch.2
txif equ 0ch.4
rcif equ 0ch.5
cmif equ 0ch.6
eeif equ 0ch.7

pie1 equ 0ch
tmr1ie equ 0ch.0
tmr2ie equ 0ch.1
ccp1ie equ 0ch.2
txie equ 0ch.4
rcie equ 0ch.5
cmie equ 0ch.6
eeie equ 0ch.7

tmr1l equ 0eh

pcon equ 0eh
bor equ 0eh.0
por equ 0eh.1
oscf equ 0eh.3

tmr1h equ 0fh

t1con equ 10h
tmr1on equ 10h.0
tmr1cs equ 10h.1
t1sync equ 10h.2
t1oscen equ 10h.3
t1ckps0 equ 10h.4
t1ckps1 equ 10h.5

tmr2 equ 11h

t2con equ 12h
t2ckps0 equ 12h.0
t2ckps1 equ 12h.1
tmr2on equ 12h.2
toutps0 equ 12h.3
toutps1 equ 12h.4
toutps2 equ 12h.5
toutps3 equ 12h.6

pr2 equ 12h ;bank 1


ccpr1l equ 15h

ccpr1h equ 16h

ccp1con equ 17h
ccp1m0 equ 17h.0
ccp1m1 equ 17h.1
ccp1m2 equ 17h.2
ccp1m3 equ 17h.3
ccp1y equ 17h.4
ccp1x equ 17h.5
rcsta           equ     18h
spen            equ     18h.7
rx9             equ     18h.6
sren            equ     18h.5
cren            equ     18h.4
aden            equ     18h.3
ferr            equ     18h.2
oerr            equ     18h.1
rx9d            equ     18h.0
txsta equ 18h ;bank 1
csrc            equ 18h.7
tx9             equ 18h.6
txen            equ 18h.5
sync            equ 18h.4
brgh            equ 18h.2
trmt            equ 18h.1
tx9d            equ     18h.0

txreg           equ     19h
rcreg           equ     1Ah
eedata          equ 1ah           ;bank1
eeadr           equ 1bh           ;bank1
eecon1 equ 1ch           ;bank1
wrerr equ 1ch.3
wren equ 1ch.2
wr equ 1ch.1
rd equ 1ch.0

eecon2 equ 1dh ;bank 1
vrcon equ 1fh ;bank 1
vren equ 1fh.7
vroe equ 1fh.6
vrr equ 1fh.5
vr3             equ 1fh.3
vr2             equ 1fh.2
vr1             equ     1fh.1
vr0             equ 1fh.0


cmcon           equ     1Fh
c2out equ 1fh.7
c1out equ 1fh.6
c2inv equ 1fh.5
c1inv equ 1fh.4
cis equ 1fh.3
cm2 equ 1fh.2
cm1             equ     1fh.1
cm0             equ 1fh.0

.list
 
》記事一覧表示

新着順:4/87 《前のページ | 次のページ》
/87