SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
Hi am looking for someone with good pic microcontroller C coding knowledge to code for me SPWM using PIC18F442, this should have an ac output feedback for output voltage control with an output frequency of 50Hz, i would like two complete flowcharts one using the ECCP module and the other using the CCP module as for most microcontrollers have only the CCP module. Strictly flowcode 8 should be used, All this must depend on the info I will provide in a one folder zip file.That is to say, the flowchats should be based on the info in the folder and the coder must be ready to exaplain every detail in the code because I like asking questions with seeable examples. The spwm should be 4 signals that I will feed to a high side / low side driver to drive my H bridge MOSFET config. For both ECCP and CCP flowchart versions, I only require the spwm part, these other things like LVD (battery Low Voltage Disconnect) , Temp sense, Display and the rest will be coded by me to make a complete project I only need the spwm generation part with feedback. PIC18F442 does not have ECCP so for the ECCP version please use PIC16F684 and for CCP version please use PIC18F442. The folder is included below, all files in there are PDF format and the password after extraction is 12345 Note: please am kindly asking don't be too expensive for me as this is a learning project and a complete one to be used in my home and my mother's home thanks guys.
- Attachments
-
- Pure sine wave inverter.zip
- (2.66 MiB) Downloaded 554 times
Re: SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
The password works very well it is 12345 but the PDF that explains it very well is down below read for download.
- Attachments
-
- Demystifying The Use of Table Point.pdf
- (505.38 KiB) Downloaded 472 times
Re: SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
For easy understanding please use exactly the same variables in flowcode as the guy used in his code in mikroC.Thanks for you time friend.
Re: SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
Since most Microcontrollers don't have the ECCP but have the CCP instead, its better to use the PDF below to make it easy when choosing an MCU.Take note, in this PDF, he first shows the code with the use of the ECCP at the top of the page then after goes ahead and give you the CCP code showing all the changes.This is really great info guys.But if one wants to understand clearly how the code works then go thru' the PDF with the ECCP first, then get back to this one below. Thanks guys.
- Attachments
-
- Sine Wave Generation without ECCP -.pdf
- (638.02 KiB) Downloaded 500 times
Re: SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
I was trying to play around with the code trying to see if I can personally change the code to flow code and this is what I came up with but don't even know if it works because I couldn't compile it and test in proteus coz I think I exceeded the space on the MCU.But anyways, have a look at the code I came up with and advise me coz I love to learn from pro people .Thanks again guys.
- Attachments
-
- SPWM test code.fcfx
- (10.88 KiB) Downloaded 479 times
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: SPWM (Sinusoidal Pulse Width Modulation) Programmer Needed
Good - progress!
A couple of things you need:
To access FC variables in C blocks - prefix them with FCV_ for global variables or FCL_ for local variables (and name is all uppercase - even if not so in FC)
You haven't defined a lookup table - called lut1 in your C code in the interrupt handler. You have used a LUT component (which gets called FCD_00fb1_lut1__INTLIST_LUT - which is stored in ROM). The easiest route here is to use an array and initialise that then you can use FCV_LUT[index] in the C block).
The interrupt handler doesn't need to check or clear TMR1F_bit - FC handles this for you.
Martin
A couple of things you need:
To access FC variables in C blocks - prefix them with FCV_ for global variables or FCL_ for local variables (and name is all uppercase - even if not so in FC)
You haven't defined a lookup table - called lut1 in your C code in the interrupt handler. You have used a LUT component (which gets called FCD_00fb1_lut1__INTLIST_LUT - which is stored in ROM). The easiest route here is to use an array and initialise that then you can use FCV_LUT[index] in the C block).
The interrupt handler doesn't need to check or clear TMR1F_bit - FC handles this for you.
Martin