I'm building a project I seen in an electronics mag that is using a C671 PIC, that PWM's a hexfet to run a DC motor. The original ASM code is generating about 20ms wide pulse widths (50hz). I am looking to use this to drive a fuel pump at different speeds. I don't know the exact specs of the pump yet, but I assume that it can do something like 40+ pounds of pressure. The question: Is there an "optimal" PWM cycle size that I should be using for this kind of DC motor? Does it depend on what speed it is running at? i.e., could/should I code it so that it has a different PWM frequency at different motor speeds for optimal tourqe & minimal motor core loses? Or would you recommend just throwing a certain sized capacitor in there to even out the DC pulses? I could easily rewrite the code to do 5ms wide PWM cycles, or less, and wondered how this would affect torque at different motor speeds. I'm thinking that a faster PWM cycle would mean a faster response time, when conditions that affect the PWM duty cycle change. On another note, but for the same project.... I've got a C671JW from Digikey to use on this project. It has a plated (brass/copper/gold, dunno) metal casing, and does not have the standard pin1 dimple that the plastic C671 OTP parts have on them. Looked at/in data sheets for it, and it doesn't show anything about that (that I can find any ways). Can I assume that Pin1 is by the MicroChip (M) logo on that chip? Also, I noted in the data sheets for the JW part, that the internal frequency calibration would be lost if I erase it (the current code uses that). How do I retrieve that information prior to programming it? Just have my Epic read it, look at the last memory location for that data? I just did that on one of my 671 OTP's, and looked at the Epicwin "code" window. All of the memory locations are 3fff, except the last one, which is 3480. So, do I put the x'80' value there in my program at that location? I assume that the x'34' is the "retlw" opcode, or do I have it backwards? I did read the data sheet, and just need confirmation on this... Can I also assume that I'll have to read that internal calibration on each OTP chip I use before programming it too? If so, does anyone have a somewhat "automated" script, or method, for doing this; or does this process have to be done manually for each OTP chip (read code, change calibration byte in code, compile code, program chip)? BTW, How accurate is that preprogrammed calibration? Sorry about all the stupid questions, this is my first time working with all these different parts and factors. Any help on any of this is greatly appreciated. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics