I had a problem like this and it was due to the pins being set to analog mode. The debugger sets all analog pins to digital but when executing without debugger the pins are not configured. Are you sure you are configuring the ADPCFGxx bits correctly? Isaac Em 22/6/2012 14:12, Andre Abelian escreveu: > Hi All, > > I am using dsPIC33FJ256MC710A ,microchip c30 compiler and MPLAB X. the pr= oblem I am having sounds really simple > but this is my second week I can't get 4 input pins that connected 4 swit= ches to work when I run debugger it works but=20 > when I program it looks like 4 inputs do not read at all. knowing read mo= dify write from the passed I made pins digital. > I tried using LAT , logic mask, internal clock still it doesn't work when= I program. it always work when I run debugger > with or without break points. I changes the clock speed still same resul= t. > > hardware info > B5,B4,B3,D7 are connected 4 switches and have external 2.2k pull ups.=20 > OC1 is used to driver stepper motor > > when I program it still works but only switches do not read and the resul= t returns is 0 > > in software lots of test code I comment out that way you can see what's h= appening. > > we are talking about simple switch test that doesn't work like > > if (PORTBbits.RB4 =3D=3D 0) > { > step_data &=3D0xFE ; > } > else > { > step_data |=3D 1; > } > =20 > attachment is the file I work on > > any idea? > > thanks > > Andre > > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .