Hi Danny, Seems like you have a very good handle on what affects the PIC pin switching speed. Have you considered doing some tests? For example, you could write some code which just toggled the pin (being careful not to run into read-modify-write problems), put a worst-case capacitive load on the pin, and then scope the voltage on the pin to measure the rise time. You could do this to several pins on the PIC and also to several different PICs. You could also vary the temperature using a hair-dryer and possibly some freeze-spray to see how much temperature affects it. This would give you a nice little dataset which may be adequate for your needs. If you use the actual FET instead of a fixed capacitor on the pin, just watch out that the gate charge will depend on what the drain is attached to (which you seem to realize already). You would probably have to actually put the full current through the external FET to be sure it was presenting a realistic load to the PIC pin. Microchip may or may not have the data you are interested in. Have you tried contacting your local rep or microchip headquarters? Sean On Fri, Sep 26, 2008 at 2:49 AM, Danny Miller wrote: > The problem is not in toggling the pin, this has nothing to do with > code. The problem is the heat generation in a transistor is dependent > on the PIC pin's switching time. Switching time is an interaction of > the pin's driving capabilities on that transistor under the conditions > in which it is used. > > The PIC datasheet switching time for a 50pF load is not valid for a pin > driving a heavy gate capacitance. Nor can we really extrapolate > switching time from just the 50pF load switching time and the 20mA > Absolute Max Iout. In fact rise/fall time figures don't tell the whole > story anyways since gate loading is not actually a simple capacitor, the > drain-to-gate capacitance causes capacitive current to the gate when Vds > changes. So it is much better to have a more specific model of what the > pin actually does. > > Danny > > Ranjan wrote: >> Hi Danny, >> have you tried the PWM modue ? It helps you generating a >> desired switching freq. You put the load feedback over an ADC pin, use the >> ADC output to vary the rise and fall timing of that switching friquency. >> >> Thanks >> >> On 9/26/08, Danny Miller wrote: >> >>> OK, trying this again with a tag- >>> >>> I would like to simulate a PIC pin from an 18F/30F or 33F driving a >>> MOSFET. I can get the MOSFET model and the rest of the circuit's parts' >>> models no problem. But, the driving abilities of the PIC itself will be >>> quite important and will likely establish the upper limit on switching >>> freq. All I know from the spec sheet is the pin's absolute max output >>> current (much lower on 33F than 18F/30F). That doesn't tell me anything >>> really. As far as I can tell that's the point where a pin could be >>> damaged, but not indicative of pin performance. So modeling as a 20mA >>> current source with a 5V/0V limit is probably way off base. Rise and fall >>> times will change with loading, which is the critical part I need to see >>> simulated, so a fixed rise and fall time on the pin is not appropriate >>> either. >>> >>> So is there a SPICE model of the output on a PIC? I assume even just an >>> nmos/pmos inverter pair could be a fairly close model if the parameters were >>> right. Google is failing me however, as is searching Microchip. Am I >>> missing something about the need to do this? Surely others have >>> wanted to model this! >>> >>> Thanks, >>> Danny >>> >>> -- >>> http://www.piclist.com PIC/SX FAQ & list archive >>> View/change your membership options at >>> http://mailman.mit.edu/mailman/listinfo/piclist >>> >>> >> >> >> >> > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist