pull up question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

pull up question

1,358 次查看
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 回复数

746 次查看
peg
Senior Contributor IV

Hello yecosuma,

 

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

 

0 项奖励
回复

746 次查看
yecosuma
Contributor III

the configuration is normal

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

have i that set other register?

0 项奖励
回复

746 次查看
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 项奖励
回复

746 次查看
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 项奖励
回复