I was just thinking if you set up RBIE by accident by any chance and then i= t generates an unhanded interrupt when you put the pin high? Can you mirror PORTB to PORTA and check whenever the code is working as expected (to check if that is an electrical issue or code flow issue) Tamas On Tue, Mar 22, 2011 at 8:16 AM, Clint Sharp wrote: > In message <4D8811C9.1080107@talktalk.net>, Oli Glaser > writes > >On 22/03/2011 02:55, Kerry Wentworth wrote: > >> I don't see where you're clearing ANSEL. It powers up as all 1s. maki= ng > >> all pins that are analog capable into analog inputs. > >> > >> Kerry > >> > >> > > > >I saw that, but RB0 (or 1) is not an analogue pin, whereas RA1, which > >worked is. > >Unless the OP got the pin names mixed up (he did say RA0, then RA1 - or > >did he mean RA0 *and* RB0 didn't work, but RA1/RB1 did?) > >Some clarification needed I think.. > > > Sorry, my bad, I should have asked what the difference between RA1 and > RB0 is (I've tried a few different PORTB pins), RA0 is indeed used as > analogue, ANSEL/TRISA are set up further on in the code. > > RA1,2,3,4 work with the servo, RB0,1,2,3,4,5 don't, all give the same > result with a 'High' and no pulses. The way the code is written allows > me to 'move' the servo output to a different port pin by just changing a > #define as all pins that aren't used as analogue are set as output. > > I found some ready written code for a 12F675 to check my servos are OK > and, predictably, they work perfectly so it's definitely my chips or > code. > > I've used 3 chips (all same date code) on 2 dev boards (identical) and > also on a breadboard with the absolute minimum to get it to run (I.E. a > pull-up on MCLR and a stiff 5v supply), again, PORTB doesn't work with a > servo attached but PORTA does. > > I suspect an electrical difference between ports that I'm missing in the > datasheet as I have discovered by accident that a 1K resistor between > RB0 and the servo works, I'd still like to know what the difference is > so I know what/how for future reference and don't get caught again. > > -- > Clint Sharp > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .