pull up question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

pull up question

1,045 Views
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

Labels (1)
0 Kudos
4 Replies

433 Views
peg
Senior Contributor IV

Hello yecosuma,

 

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

 

0 Kudos

433 Views
yecosuma
Contributor III

the configuration is normal

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

have i that set other register?

0 Kudos

433 Views
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 Kudos

433 Views
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 Kudos