External Dallas Temp Sensor


I would like to use a standard Dallas DS18B20 as external sensor on a PortuxG20 mini-PC,
I read that PS29 pin was not wired on PXB, is there a way to assign the 1-Wire bus to another pin (externally wired on mini-PC ?)

Changing this code below in arch/arm/match-at92/board-portuxg20.c can have effect ? which pin would you use ?


* Dallas 1-Wire
static struct w1_gpio_platform_data portuxg20_w1_gpio_pdata = {
.pin = AT91_PIN_PA29,
.is_open_drain = 1,

static struct platform_device portuxg20_w1_device = {
.name = "w1-gpio",
.id = -1,
.dev.platform_data = &portuxg20_w1_gpio_pdata,

void portuxg20_add_w1(void)
at91_set_GPIO_periph(portuxg20_w1_gpio_pdata.pin, 1);
at91_set_multi_drive(portuxg20_w1_gpio_pdata.pin, 1);

Re: External Dallas Temp Sensor

I meant PA29, not PS29 .. sorry :-)

Re: External Dallas Temp Sensor

Yes you can change the pin used for 1wire. It is also possible to duplicate the code for another pin.

Re: External Dallas Temp Sensor

Thanks for your answer how can i change the pin ?

Should I simply replace


to get it on pin 2 of IF0 ? (as far as I understand in http://armbedded.eu/documentation/pdf/portuxg20technicalreference.pdf)

Will it work ?

Thanks for you support

Re: External Dallas Temp Sensor

Yes this should work, if AT91_PIN_PB22 is free to use.

Re: External Dallas Temp Sensor

I will try this, thanks !

Syndicate content