Re: 關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
版主
|
你不是結婚了嗎??? 還敢去把馬子不怕皮癢啊!
發表於: 2006/5/8 17:56
|
|||
|
Re: 關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
資深會員
|
3Q , 3Q....個位大哥大指正, 簡單程式可以RUN啦!!!
因為是第一次使用16F505 我需要6個OUTPUT... 原本寫的程式變化比較多, 不知當在何處 ????? 以為是設定錯誤 一時心急, 把程式簡化後,,,, 居然忘了goto main .. 所以更不RUN啦!! 此次經驗是... 凡事急不得, 越急越看不到錯誤 .. 碰到問題解決不了, 先放下來 ... 帶狗兒出去散個步....逛逛MALL... 把把馬子... 聽聽音樂..... 好啦... 可以把原本寫的程式 ,再來看看是那兒臭臭啦 !!! Have a nice weekend everybody and take care ,3Q lar!
發表於: 2006/5/6 1:37
|
|||
|
Re: 關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
版主
|
程式用 MPLAB SIM + Watch Window 可以執行,PORTC 的 Clock 也可以送出來,PORTB 的位元變化也正確,只是程式沒有正確的迴圈會造成當機,請加入一行 goto main 如下所示:
clrf PORTC ; Turn off CLK. bsf PORTB,1 ; turnoff GREEN led. goto main ; delay_0.1s movlw d'100' ; 100ms
發表於: 2006/5/5 11:51
|
|||
|
Re: 關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
資深會員
|
mplab sim 很正常
只是 delay_0.1s 前面少了一個 goto main 導致程式執行到 delay_0.1s 前一行會進入 delay_0.1s 而導致 stack overflow,而reset 你所謂不會run?是那裏不會run?
發表於: 2006/5/5 11:32
|
|||
|
Re: 關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
資深會員
|
3Q Lar!!!! . 那如此設定對不對呢??
還有我查看MAP, 所有REGISTER FILE 都在Bank0, 那我還需要下banksel 指令嗎 ??? 還有 BUILD OK, 但是程式不會RUN??? 可否幫忙看看那兒錯啦!!!!!! 3Q lar!!!
; PIC16F505 TRI-COLOR LED FLASHER FOR MY DOGGIE 05/04/2006
發表於: 2006/5/5 0:48
|
|||
|
Re: 關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
版主
|
上述除了 OSCCAL 是暫存器外,其餘的OPTION & TRIS都是16C5x 專用的指令,使用時需注意。有關RAM BANK 的切換可以使用 banksel 這個 directive instruction.
發表於: 2006/5/4 18:34
|
|||
|
關於16F505.. 笨鴨有疑問請教???
|
||||
---|---|---|---|---|
資深會員
|
Dear All :
請教16F505, 一開始設定 OSCCAL, OPTION ,TRIS...時需要先設定BANK嗎?? 3Q !!!!
發表於: 2006/5/4 7:52
|
|||
|