In SX Microcontrollers, SX/B Compiler and SX-Key Tool, metron9 wrote: After reading this: For more on Read/Modify/Write problems (which are a seperate issue) see: http://www.sxlist.com/techref/readmodwrite.htm This is really good information to know thanks James. It looks like that could very well be the problem in this code! Perhaps use pause between setting HIGH's or write the whole port at once. Initialize_8255: 'Initialize 8255 to All Outputs at Active Low state RB_OUT = $FF 'RB pins (Control lines are set Inactive HIGH) ' PAUSE 1 'Settling time for a few ms (50 ms) LOW Reset_8255 '8255 is Reset (Active) HIGH WR_8255 'Set Write control High (Inactive) HIGH A1_8255 'Set Address control A1 & A0 High to access the control word register HIGH A0_8255 RC_OUT = $80 'Set databus (D0-D1 of 8255) to $80 for MODE 0 - All 3 8255 ports as outputs LOW CS1_8255 'Set Chip Select Low (Active) PULSOUT WR_8255, 10 'Pulse Write control Low (Active) for 100 us (duration not critical) HIGH CS1_8255 'Set Chip Select High (Inactive) - All 8255 outputs are set to Active Low RETURN ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=153066#m153187 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)