three level pwm using pic
three level pwm using pic
hi...
can anybbody pls help me...
how to generate three level pwm using pic 16f628...
how to actually create triangular and sine lookup table...
i'm new to pic...and trying so hard to learn how to program it!!!
can anybbody pls help me...
how to generate three level pwm using pic 16f628...
how to actually create triangular and sine lookup table...
i'm new to pic...and trying so hard to learn how to program it!!!
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: three level pwm using pic
Hello
Here are some examples of look up tables using Flowcode.
http://www.matrixmultimedia.com/mmforum ... =LUT#p5509
Hope this helps.
Here are some examples of look up tables using Flowcode.
http://www.matrixmultimedia.com/mmforum ... =LUT#p5509
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: three level pwm using pic
Yeah..thanks a lot...
does the triangle lookup table also use the same method as sine table.
how to program it using assembly language?
and one more thing..what is actually flowcode...

does the triangle lookup table also use the same method as sine table.
how to program it using assembly language?
and one more thing..what is actually flowcode...


- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: three level pwm using pic
Hello
Yes any look up table can be performed using the method shown. Good luck in assembler!
Flowcode is a high level graphical language for PICs, AVR and ARM. You can download a demo from here.
http://www.matrixmultimedia.com/Flowcode3a-X.php
Yes any look up table can be performed using the method shown. Good luck in assembler!
Flowcode is a high level graphical language for PICs, AVR and ARM. You can download a demo from here.
http://www.matrixmultimedia.com/Flowcode3a-X.php
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: three level pwm using pic
hi..
if we use the comparator to generate pwm,it is possible that we use external source rite...for instant if we use sine voltage,then we dont need sine lookup table anymore rite??

if we use the comparator to generate pwm,it is possible that we use external source rite...for instant if we use sine voltage,then we dont need sine lookup table anymore rite??

- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: three level pwm using pic
Hello
This search may prove useful to you.
http://www.google.co.uk/search?hl=en&q= ... arch&meta=
Example of assembler look up table.
http://web.hazmat.com/~mjb/projects/rswg/
The comparitors compare two analogue signals to provide greater then, less then or equal. Not quite sure how this would help the PWM operation. You could use analogue readings to take in your external signal but you will then have the problem of synching the readings with a full period of the wave.
This search may prove useful to you.
http://www.google.co.uk/search?hl=en&q= ... arch&meta=
Example of assembler look up table.
http://web.hazmat.com/~mjb/projects/rswg/
The comparitors compare two analogue signals to provide greater then, less then or equal. Not quite sure how this would help the PWM operation. You could use analogue readings to take in your external signal but you will then have the problem of synching the readings with a full period of the wave.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: three level pwm using pic
hi..
thanks a lot for the link...
the project that im doing rite now requires me to use the pic for the switching scheme for my inverter...
so..in order to 'on' or 'off' the switches, i need to use the pwm method...i need to generate 3 level pwm by using sine wave and two triangular wave...
currently im using pic16f628...but i dont know whether to use timer1 or timer2...
sorry...im a bit slow in programming..
thanks a lot for the link...
the project that im doing rite now requires me to use the pic for the switching scheme for my inverter...
so..in order to 'on' or 'off' the switches, i need to use the pwm method...i need to generate 3 level pwm by using sine wave and two triangular wave...
currently im using pic16f628...but i dont know whether to use timer1 or timer2...
sorry...im a bit slow in programming..

Re: three level pwm using pic
hi..
if i want the output to be analog, what pic that i should use?
anybody knows???
if i want the output to be analog, what pic that i should use?
anybody knows???
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: three level pwm using pic
Hello
There are a couple of ways of outputting analogue using the PICmicro devices.
1) A 8-bit R2R ladder network.
2) PWM with a stabilizing cap.
The PWM method seems to be less noisy and also less costly as you only need a capacitor instead of around 24 resistors.
There are a couple of ways of outputting analogue using the PICmicro devices.
1) A 8-bit R2R ladder network.
2) PWM with a stabilizing cap.
The PWM method seems to be less noisy and also less costly as you only need a capacitor instead of around 24 resistors.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: three level pwm using pic
hi....
what is stabalizing cap means??
and one more thing, how does the output of the p16f628 is like,i.e is it in 8 bit output or its output in serial bit....
im doing the lookup table....does each of the data occupy one memory add???or the memory location is replaced from one data to another;
this is the sample of my lookup table:
sinetable equ 0x20
lookup1 movf sinetable,w
addwf PCL
retlw 1
retlw 3
retlw 4
retlw 6
retlw 7
retlw 8
and many more data following this...approximately there are 180 data....
so...how does the output of this data will come out...i mean after it goes through comparator...
what is stabalizing cap means??
and one more thing, how does the output of the p16f628 is like,i.e is it in 8 bit output or its output in serial bit....
im doing the lookup table....does each of the data occupy one memory add???or the memory location is replaced from one data to another;
this is the sample of my lookup table:
sinetable equ 0x20
lookup1 movf sinetable,w
addwf PCL
retlw 1
retlw 3
retlw 4
retlw 6
retlw 7
retlw 8
and many more data following this...approximately there are 180 data....
so...how does the output of this data will come out...i mean after it goes through comparator...
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: three level pwm using pic
Hello
A capacitor can be placed between the PWM output and ground. This will act to smooth out the PWM and give you a nice analogue output signal. The Time constant of the capacitor should be approximatly 3 periods of the PWM to allow for nice smoothing without missing too much information.
Yes each data chunk in your lookup table will consume one byte of memory.
A capacitor can be placed between the PWM output and ground. This will act to smooth out the PWM and give you a nice analogue output signal. The Time constant of the capacitor should be approximatly 3 periods of the PWM to allow for nice smoothing without missing too much information.
Depends if your using digital outputs, the UART hardware or the PWM hardware onboard the device.how does the output of the p16f628 is like
Yes each data chunk in your lookup table will consume one byte of memory.
Depends if your using digital outputs, the UART hardware or the PWM hardware onboard the device.how does the output of this data will come out...i mean after it goes through comparator
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 114
- Joined: Fri Jul 27, 2007 10:50 am
- Been thanked: 1 time
Re: three level pwm using pic
Maybe speaking out of turn here. My understanding of PWM is that you need to pass it through a low pass filter i.e. A resistor in series and Capacitor in parallel. The cut off frequency for the low pass filter is given by 1/(2 * pi * R * C ). The cut off frequency being the frequency that the signal starts to be attenuated. If you want faster attenuation you add another low pass filter in series i.e. you end up with 2 resistors in series and 2 capacitors in parallel. Being naive about such things I would have expected to have the cut-off frequency the same as the PWM frequency to get a sine wave ( Fourier analysis etc ) But for some reason all of the circuits I have seen seem to cut in earlier.
Re: three level pwm using pic
Hi...
thanks for all your guides....
after read the datasheet, i found out that the pic allows analog input, for the comparator mode...
so this means that i can directly supply analog input to the pic and the comparator will do it works...rite??...
and i just need to do some delay to the pic...the question is...what the purpose of the delay if i use the analog input...
thanks for all your guides....
after read the datasheet, i found out that the pic allows analog input, for the comparator mode...
so this means that i can directly supply analog input to the pic and the comparator will do it works...rite??...
and i just need to do some delay to the pic...the question is...what the purpose of the delay if i use the analog input...