hui j wang

confusion about IO PORT on HC908

Discussion created by hui j wang on Nov 26, 2007
Latest reply on Nov 30, 2007 by Ake Webjorn
HI,
 
I am quite confused about the HI-Z status of IO port on HC908 MCU.
 
When I want to connect some 1-wire parts to HC908 I need to set the 1-wire pin high or low.
 
I used to connect a pull up resistor on the 1-wire pin to VCC and control the pin through the DDRx register instead of PTx register, for instance, I will first set this 1-wire pin port register to 0 thus to keep this pin latch to 0 and this will remains unchangeable, when I need the 1-wire pin to be low, write DDRx=1, if I need it to be high,write DDRX=0 the external pull up resistor will pull up the bus to high level. This works on avr MCUs.
 
When I use this on HC908, I failed. Changing the DDRx doesn't change the pin voltage level. I don't know whether I am somewhere wrong or the HC908 MCUs just work so.
 
Anyone knows this, I would like to hear you very much.
 
Regards,
ryan


Message Edited by ryan. on 2007-11-26 08:57 AM

Outcomes