- Joined
- Jul 4, 2009
- Messages
- 16,572
- Helped
- 5,158
- Reputation
- 10,349
- Reaction score
- 5,225
- Trophy points
- 1,393
- Location
- Aberdyfi, West Wales, UK
- Activity points
- 140,152
I never mentioned Pickit3, I don't have one myself but I can still debug programs. In MPLAB, if you check through the menus you will find an option to select which debugger to use, if you select the simulator instead of PM3, it will let you run the program in a simulated environment, you don't need any hardware attached at all.
I don't have MPLAB installed, I use MPLABX under Linux but if you find the 16F1508 is too recent for the MPLAB simulator, try downloading MPLABX and even if you don't want to use it, copy the assembler and simulator .exe files to your MPLAB folder, I can't try it myself (no Windows!) but I think it will work. MPLAB and MPLABX are just front ends for stand-alone assemblers and simulators so they are probably compatible.
There is nothing wrong with using the CWG but it isn't really intended for your purpose. It is optimised for driving H-bridge circuits that need dead time during the switch over so much of it's initialization isn't necessary. You are only using it as an inverter which is why I suggested hardware may be easier.
As I see it, you can configure the NCO to generate the lowest frequency in the same way as I suggested PWM should be set. Use FDC mode and put the step in frequecy in the increment registers. Still use another timer to generate say 1mS interrupts and use them as I suggested to set the step rate to the next frequency until your target is reached.
To use CWG, simply use the NCO output as the CWG source and select opposite polarities to the output pins.
Brian.
I don't have MPLAB installed, I use MPLABX under Linux but if you find the 16F1508 is too recent for the MPLAB simulator, try downloading MPLABX and even if you don't want to use it, copy the assembler and simulator .exe files to your MPLAB folder, I can't try it myself (no Windows!) but I think it will work. MPLAB and MPLABX are just front ends for stand-alone assemblers and simulators so they are probably compatible.
There is nothing wrong with using the CWG but it isn't really intended for your purpose. It is optimised for driving H-bridge circuits that need dead time during the switch over so much of it's initialization isn't necessary. You are only using it as an inverter which is why I suggested hardware may be easier.
As I see it, you can configure the NCO to generate the lowest frequency in the same way as I suggested PWM should be set. Use FDC mode and put the step in frequecy in the increment registers. Still use another timer to generate say 1mS interrupts and use them as I suggested to set the step rate to the next frequency until your target is reached.
To use CWG, simply use the NCO output as the CWG source and select opposite polarities to the output pins.
Brian.