Hi Patyrk, I don't know the DS2408 but it sounds like an 8 channel version of the DS2406 which I am using. I found it very confusing at first as the same pin is used for input and output, also the logic is the reverse of devices I have used in the past.
The input reads 1 if it is at +5v and 0 if it is at ground. the output takes the pin to ground when PIO = 1 and it floats if PIO = 0 This means that if you are using it as an input PIO must be set to 0, if it is 1 then it pulls the pin to ground whatever the state of your external switch. Also writing 0 to either of the latches resets both of them, I don't know if that is the case with the DS2408 I hope that helps, I know I have to go through it all again to get it clear in my mind each time I do anything with it. Cheers Mick On Wed, 2011-02-09 at 02:16 +0100, patyrk wrote: > Hello > I have some problems with using buttons in Hobby Boards LCD design. It's > on DS2408. Before I initialize the LCD by writing something to screen > sensed.1 and latch.1 work fine. PIO.1 is is connected to VCC through > 10kOhm resistor and then to the switch and GND(exactly like in HB > design). > cat /mnt/owfs/lcd/sensed.1 gives 1 when button isn't pushed and 0 when > pushed. > After writing > printf "1" > /mnt/owfs/lcd/LCD_H/clear > > cat /mnt/owfs/lcd/sensed.1 gives 0 all the time > > I noticed that owfs puts 1 after LCD_H operations on unused PIO.0 PIO.1 > PIO.3 and this messes up reading button states. > If I do printf "0" > /mnt/owfs/lcd/PIO.1 the buttons works fine again > > I also wrote before that changing this PIOs after LCD operations makes > difficult using them also as output. Is there any reason for them to be > set to 1 every LCD operation? > > The best way to handle it would be leaving them as the where. > > I'm using the latest version 2.8p6 and ds2480b master on WRT54g running > OpenWrt > ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers