John De Villiers wrote: > > I've gone through the picNpoke tutorials, and now i have a few questions. > > 1) What does open collector output mean. What should i consider in the > circuit diagram for this pin. > 2) What does weak pull-ups mean. These subjects are covered in PicNPort under [Open Collector] and [Pullups]. You can think of an open collector output as a transistor switch connected to ground. When the output is set to logic 1, the switch is OFF and the pin is in a high impedance state. Logic 0 turns the switch on and a current path to ground is produced. This means an open collector pin can only sink current into the pin. It cannot source current out of the pin. > 3) Is there a latency between setting a pin to high and when it actually > does go high, and if there is, what should my minimum time delay be if i > want to take it high and low very fast - ie 400ns ( 10 MHZ low instuction > immediately after a high ) Looking at the AC characteristics in the data sheet is a bit vague. It appears there is a delay for the port pin to react which seems to be TosH2ioV, but no timing figures are mentioned. A lot also depends on what is connected to the pin. > 4) if RB7:4 is set to interrupt and RB5&4 are to outputs, will i > inadvertently generate an intterupt when i write to bits 4 and 5. According to the data sheet, the interrupt on change feature is only active on pins set as inputs. There is an AND gate controlled by the TRIS latch which masks the port change. > 5) does anyone have a 5digit bcd to 16bit binary routine please. My mind is > going numb trying to work that one out. i can do it on paper though A simple but perhaps long method is.. while X is positive (subtract 10000 - increment 10000 counter) else add 10000 while X is positive (subtract 1000 - increment 1000 counter) else add 1000 while X is positive (subtract 100 - increment 100 counter) else add 100 while X is positive (subtract 10 - increment 10 counter) else add 10 while X is positive (subtract 1 - increment 1 counter) > 6) I want to use a pic for a dimmer switch. what is the easiest way to tap > 5vdc from a 220vac line. I want to mount it inside the light switch cover if > at all possible. Can't help there, I haven't tried it, but be careful or you may be the XMAS tree lights this year. -- Best regards Tony http://www.picnpoke.com Email sales@picnpoke.com