Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
版主
|
Yes, you are right.
Recommend to use the directive instrunction "pagesel ANSEL" instead of "bsf STATUS,RP0"
發表於: 2007/4/18 8:29
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
版主
|
鴉先生,
你還是沒有將 Data Sheet 看的很清楚,在 PIC12F629/675 的 Data Sheet 中 FIGURE 2-2 Data Memory Map 裏在最後的注解裡有說 ANSEL 等 ADC 的暫存器只存在於 PIC12F675,PIC12F629 則沒有這些佔存器,INC 檔應該找不到這些 Register 的定義。
發表於: 2007/4/17 9:40
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
資深會員
|
3Q lar! 原來如此...
雖然12F629沒有A/D , 但是 也要設定ANSEL一下... 嗯 ... 真不知道是12F629笨 , 還是笨鴨偶IQ低耶?? 呵..呵..
發表於: 2007/4/17 1:56
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
版主
|
鴉先生,
PIC12F629 的GP0 & GP1內建有電壓比較器的輸入,請參考 Data Sheet 6.2 Comparator Configuration Setting 就知道了。 hellowanz 已經告訴你答案了 ,設定一下 CMCON register
發表於: 2007/4/16 9:44
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
資深會員
|
試試看以下設定
bcf STATUS,RP0 ;Bank 0 clrf GPIO ;Init GPIO movlw 07h ;Set GP<2:0> to movwf CMCON ;digital IO bsf STATUS,RP0 ;Bank 1 clrf ANSEL ;Digital I/O movlw 08h ;Set GP<3> as inputs movwf TRISIO ;and set GP<5:4,1:0>as outputs bcf STATUS,RP0 ;Bank 0
發表於: 2007/4/14 23:28
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
資深會員
|
Dear All ,
大略看了一下 12F629 DATASHEET ; 看起來12F508程式不必大改應該可以用在12F629, 但是有個問題12F629,好像不能執行下列指令.. 如果我想設定 GPIO0,1,2 為 ’H’ output . bsf GPIO,0 bsf GPIO,1 bsf GPIO,2 結果好像只有 第三個指令GPIO,2會執行也? ( GPIO0,1,2已設定為output. ) 12F508就沒有這個問題 奇不奇怪呀?
發表於: 2007/4/14 0:13
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
資深會員
|
笨鴨看了一下 12F629...
呦... 還真的比12F508 ,強很多耶!!! 以往只會玩玩10F20X, 12F508系列;;; 看來該改用12F629 囉... 謝謝, 阿里阿多 ,3Q lar! 嗯... 又有好多資料需要 K K ...
發表於: 2007/4/11 0:56
|
|||
|
Re: 如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
資深會員
|
換 成 12f 675/629 ,程式不用大改
mcu 已經內建 eeprom 只要在 設定改變的時候存資料,基本上是不用理會斷電這個條件 eeprom 的讀寫, datasheet 上面有
發表於: 2007/4/9 8:49
|
|||
|
如何儲存 1 Byte data..
|
||||
---|---|---|---|---|
資深會員
|
Dear All ;
笨鴨在玩12F508觸控燈光控制線路時, 碰到一個簡單的大問題...對偶而言啦!!! 就素----------> 不知有沒有一個簡單的方法來儲存1 Byte data; 可以在停電後, 再供電時, 將最後的設定亮度復原. 我的程式會把最後的設定亮度值存在 temp register, 但是停電後當然會消失啦... But but but ... 偶不想用 S-EEPROM 24C01, 來儲存1 Byte data , 一來太浪費,,,, 再說笨鴨偶....也還不會寫Read/Write程式, 所以啦.. 不知有沒有一個簡單的笨方法來儲存1 Byte data呢? 素不是一個笨問題踗???? 呵!!呵 !!!
發表於: 2007/4/6 1:11
|
|||
|