DSPRelated.com
Forums

1-wire and I/O switching

Started by Thomas November 30, 2005
Hello everyone,
It seems I have ran into a wall or I'm missing an EE type deal with my
lack of electral engineering knowledege for an 56f805. I have
programmed my DSP to talk to a 1-wire temp sensor. The problem I am
having is I can configure the pin as an output and pull the pin active
low to reset the device but when it talks back I can not seem to
capture this on the same pin. I am switching to input right after I
let the pin go high but when I check it every 15us (a timer interupt)
nothing is on the input. Is it possible that it takes 60us (I can see
and measure the return pulse on the scope) to switch the pin from
output to input? I can take the pin connector off after and touch it
to ground and get the pin to register the input. So I would think its
configuring it self correctly but who knows because it doesn't work
for the return pulse.


Try this approach
1) Set internal pull-up enable in Pull-up Enable
register. Or disable internal pull-up and add external
pull-up resistor if you want logic high close to 3.3V
2) Set corresponding bit in Data Register to Low. So
pin always outputs logic low in output mode.
3) Toggle corresponding bit in Data Direction
Register. So when this bit is set, pin is an output
pin with logic 0 output. When this bit is cleared, pin
is in input mode with output logic high.

So just single action, toggling data direction bit you
can achieve both set the pin between inpu mode or
output mode; 2) output the logic low or high without
changing Data register value.

Charlie

--- Thomas <tommyjt24@tomm...> wrote:

> Hello everyone,
> It seems I have ran into a wall or I'm missing an EE
> type deal with my
> lack of electral engineering knowledege for an
> 56f805. I have
> programmed my DSP to talk to a 1-wire temp sensor.
> The problem I am
> having is I can configure the pin as an output and
> pull the pin active
> low to reset the device but when it talks back I can
> not seem to
> capture this on the same pin. I am switching to
> input right after I
> let the pin go high but when I check it every 15us
> (a timer interupt)
> nothing is on the input. Is it possible that it
> takes 60us (I can see
> and measure the return pulse on the scope) to switch
> the pin from
> output to input? I can take the pin connector off
> after and touch it
> to ground and get the pin to register the input. So
> I would think its
> configuring it self correctly but who knows because
> it doesn't work
> for the return pulse. >

__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com