pull up question

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

pull up question

1,322件の閲覧回数
yecosuma
Contributor III

 I want use a pull up in PTC OF THIS MCU  MC9S08LC60  BUT i obtain this message

error at location 1838  attemp to write  to read-only location

the port register PTCPE IS READ AND WRITE I DONT HAVE BECAUSE HAPPEN THIS  THANKS NEWLY FOR YOU ANSWER

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

710件の閲覧回数
peg
Senior Contributor IV

Hello yecosuma,

 

Perhaps you could show us how you are trying to do this.

 

0 件の賞賛
返信

710件の閲覧回数
yecosuma
Contributor III

the configuration is normal

 PTCDD_PTCDD0 =0;
  PTCD_PTCD0=0;
  PTCPE_PTCPE0 =1;

have i that set other register?

0 件の賞賛
返信

710件の閲覧回数
Darkn3ss
Contributor II

This is quite interesting.  I don't think this is the case, but the compiler may actually be warning you that you are writing the value of PTCD pin 0, which you set as an input the line above (inputs are read-only).

 

I also prefer to set the pullups prior to setting the direction, but that is just me.

 

 PTCDD_PTCDD0 =0;
  PTCD_PTCD0=0;   //Deleting this line won't do any harm.
  PTCPE_PTCPE0 =1;

0 件の賞賛
返信

710件の閲覧回数
yecosuma
Contributor III

thanks for you aclaration but it not working; i dont know the cause; this pins have others funtion; in code warrior debug not present error or warning but in true time simulator  occur Error: At location 1838 -
Error: Attempt to write to a read-only location just when simulating the instrution PTCPE_PTCPE0=1;. what pass this in all pins of this port?

0 件の賞賛
返信