'908JL3  0,PORTB always reads as low

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

'908JL3  0,PORTB always reads as low

ソリューションへジャンプ
1,869件の閲覧回数
admin
Specialist II

Got a =very= basic problem that is just driving me nuts.

Using a '908JL3 and going around in a loop polling the port B inputs and when one

of them is low it jumps off to flash a LED then comes back and starts polling again.

This program doesn't really do anything; it just runs the piece of code that is causing the

trouble. Something like this:

 

                    MOV    #%00000000,DDRB

 

TOP             BRCLR    3,PORTB,LED

                   BRCLR    2,PORTB,LED

                   BRCLR    1,PORTB,LED

                   BRCLR    0,PORTB,LED

                   JMP         TOP

 

LED            <FLASH LED ONCE>

                   JMP         TOP

 ------------------------------------

B3, B2, B1work just fine but B0 no way can I get it to work properly. It is always read as

if it were clear  and branches accordingly.  I tried a second MCU and then a third with a datecode 2 years earlier and still the same. Have these things got a bug or something?

It was getting to the stage I was looking around for hidden cameras, thinking someone

was playing some kind of practical joke on me. Puta scope on the pins and they go down

at the right time so it is not a board fault. This is SO stupid. 

 

Anybody have any ideas?

ラベル(1)
0 件の賞賛
返信
1 解決策
948件の閲覧回数
JimDandy
Contributor III

OK. Got it.

Was loading ADSCR with VALUE instead of #VALUE.

VALUE = 5 which is DDRD(?) address and DDRD held 11000000 so A/D multiplexor

was parked on B0 causing it to not see the HI input. Something like that.

 

Sheesh. you may have gathered I'm not a programmer... :smileysad:

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
949件の閲覧回数
JimDandy
Contributor III

OK. Got it.

Was loading ADSCR with VALUE instead of #VALUE.

VALUE = 5 which is DDRD(?) address and DDRD held 11000000 so A/D multiplexor

was parked on B0 causing it to not see the HI input. Something like that.

 

Sheesh. you may have gathered I'm not a programmer... :smileysad:

 

0 件の賞賛
返信
948件の閲覧回数
tonyp
Senior Contributor II

Monitor ROM I think uses PB0 for comms.  You're not testing under Mon ROM, are you?

0 件の賞賛
返信