Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] pic16f72 sinewave inverter with asm codes. not working.

Status
Not open for further replies.
The main problem which I have to face is that,the OSC3,OSC4 become LOW condition containing 0 volts during Charging
Its not a problem,these pins should low during charging.
If you need, we can make high these pins.
while the OSC1,OSC2 remain in working condition containing 1.5 volts each.
These pins are high for a while,till chg led start blinking.
When charging occurs,these pins start switching.
You should keep sight on pin 5 of mcu.
This pin is controlled with chg control trim pot.
Here 3.25 volts are for stable charging.
If volts at pin 5 are below then 3.25, mcu will change, and increase on time in pwm pulses.
Thus charging current also become high,volts at pin 5 also vary with charging current.
In level 56 you can change these volts.
 
  • Like
Reactions: judfid

    judfid

    Points: 2
    Helpful Answer Positive Rating
I see 50% duty cycle of pwm pulse in inverter mode at 2.4v at RA0.
RA0 is for feed back(output volt control).
PWM frequency in inverter mode is 3.2khz at each channel.
And 6.2khz at charging.

---------- Post added at 15:37 ---------- Previous post was at 15:07 ----------


"sublw" in asm is equal ADC_VALUE in c.
for example asm code,
Code:
 LEVEL_49	bcf PORTB,5
	movf BATTV,w
	btfsc STATUS,Z
	goto LEVEL_50	
	...........
And in c
Code:
 void main()
{

TRISA=0xFF; //SET PORT A AS INPUT
TRISC = 0X00; //SET PORT C AS OUTPUT
...............
}
Pnjbtr can you kindly post the entire code in c, or is it available somewhere on this thread (other than asm)
 

Mr PNJBTR and Tahmid,
i want to tell you before i am working at IR2110 and you talking about TLP250.
i want to use 4port like OS1,2,3,4 not 2 pin.
do you have done it.
if done explain.
 

OSC1, OSC2, OSC3, OSC4 are output pins from the 16F72. Doesn't matter which driver you use, their states will be the same - if you use IR2110 or TLP250 or other drivers.
 

pls am intrested in the pic16f72 pure sinewave inverter schematic circuit diagrams & code thanks. xxxxxxxx@xxxxx.xxx

If you go through this thread, you'll find that these have already been uploaded. They've been uploaded to post # 150.
 
Last edited by a moderator:

hi
what can be the maximum frequency possible for linear sinewave inverter with silicon sheet transformer?

- - - Updated - - -

can hi frequency like with ferrite core can be used in this case?
 

You have to realize that in the end, the frequency is 50Hz.

The frequency that you'll use will be limited more by the controller and the software.

For ferrite core, 2-step inverter must be used. First step up to high voltage DC and then convert back to AC using SPWM.
 

hi
for smps inverter, i am amply clear as i am making one. But i am not clear regarding the linear one. Can silicon sheet transformer withstand hi frequency if software and controller give that? Please explain as i am not clear of that and i think you can make me understand as i find from different posts that your concept regarding inverter in very good.
 

I want to use 35khz as i am using in smps inverter provided the linear one can tolerate. Should i use push pull or full bridge? What drivers should be useful you think?
 

A carrier frequency of 35kHz might not cause problems. After all, it's the carrier frequency. The frequency of the sine wave is 50Hz (or 60Hz, depending on your design).

You can use push-pull or full-bridge. If you use full-bridge, you can use the same bridge for battery charging control while charging. If you use push-pull, you will need a primary side control circuitry (usually using a TRIAC/ SCRs).

If you use push-pull, you'll need low side drivers. You can use TC427. There are many drivers you can choose from.

If you use full-bridge, you'll need high/low side drivers such as IR2110 or L6385E. There are many drivers you can choose from.

Hope this helps.
Tahmid.
 
Thank you so much tamid. Some some clear. Not fully. I hope to learn regarding carrier frequency and other tidbits later on. You are really helpful.
 

Iron core transformer is wound for 50Hz as normal 50Hz bulky transformers. Hi-frequency is simply filtered out due to high inductance in transformer. Ferrite core cannot be used in this application as 50 Hz is modulated in transformer driver stage and will not develop 50Hz ac in secondary and cause imbalance in flux in transformer with this simple driver circuit.
 
@picgak
Pnjbtr can you kindly post the entire code in c, or is it available somewhere on this thread (other than asm)
Sorry whole code in C can not now.
This project is output of reverse engineering.
@mosfet12
Some some clear. Not fully. I hope to learn regarding carrier frequency and other tidbits later on.
Although modulated frequency in these kind of sine inverters is from 6 to 15 khz, with CRGO silicon core but actual frequency is 50 or 60 Hz for electrical appliances.
 
  • Like
Reactions: judfid

    judfid

    Points: 2
    Helpful Answer Positive Rating
@picgak
Sorry whole code in C can not now.
This project is output of reverse engineering.
@mosfet12
Although modulated frequency in these kind of sine inverters is from 6 to 15 khz, with CRGO silicon core but actual frequency is 50 or 60 Hz for electrical appliances.

can any soft iron core be used in making the code,can you a short code in c for the feedback or output voltage regulation taking ACD as reading as starting point.

- - - Updated - - -

@picgak
Sorry whole code in C can not now.
This project is output of reverse engineering.
@mosfet12
Although modulated frequency in these kind of sine inverters is from 6 to 15 khz, with CRGO silicon core but actual frequency is 50 or 60 Hz for electrical appliances.

can any soft iron sheet be used for making the core,can you write a short code in c for the feedback or output voltage regulation taking ADC reading as starting point.How does the adc affect the pulse width.
 

One way of feedback for SPWM is to use multiple sine wave tables and then call the required table upon deciding the required duty cycle increment/decrement.

Check here for the technique (with sample code): https://www.edaboard.com/blog/1803/

To generate the sine wave tables, you can use the software Smart Sine: https://www.edaboard.com/blog/1798/
 
  • Like
Reactions: pnjbtr

    pnjbtr

    Points: 2
    Helpful Answer Positive Rating
Hi @pnjbtr
I'm trying to something like so call reserve engineering for this asm code to understand what is the function to calculate the feedback, based on each mode of operating. Can you please give me a hand about this?
In asm file, there's the code at LEVEL_88:
Code:
btfsc 0x51,7
	addwf 0x53,f
	rrf 0x53,f
	rrf 0x52,f
[I][B]	retlw .0[/B][/I]
	addlw .166
	addlw .255
	addlw .255
	addlw .255
	addlw .255
	movlw .10
There's retlw .0 in this pieces of code. I think it'll return and load 0 value to w register. So the remaining code will not being used. Am I right?

Hope to receive your comments soon!
Thanks and best regards,
 

There's retlw .0 in this pieces of code. I think it'll return and load 0 value to w register. So the remaining code will not being used. Am I right?
RETLW= Return with Literal in W
This instruction almost used in PCL register for Program-Counter-Modification.
In LEVEL_88 we are implementing sine table and 0 is first step.
We need to load 0 on w register.
ADDLW=Add Literal and W
addlw .166,at this time W=0+166=166(literal value 166 on W register).
Now we have literal value 166 on w register.
But next instruction addlw .255,i think not suitable because how can we,
add 166+255 in 8 bit register(d=255 or 0xFF).
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Yes you are right.
Today i edit in code and see the effect in prototype.
What i modify in code is as follows,
in LEVEL_88
Code:
	btfsc 0x51,4
	addwf 0x53,f
	rrf 0x53,f
	rrf 0x52,f
	btfsc 0x51,5
	addwf 0x53,f
	rrf 0x53,f
	rrf 0x52,f
	btfsc 0x51,6
	addwf 0x53,f
	rrf 0x53,f
	rrf 0x52,f
	btfsc 0x51,7
	addwf 0x53,f
	rrf 0x53,f
	rrf 0x52,f
   	retlw .0
    end
After modification i compare in hardware and found same result.
As we have with complete code.
In fact,i am thinking actual firmware is not written in asm.
And this code is out put through disassembly.
 
Last edited:

Code:
But next instruction addlw .255,i think not suitable because how can we,
add 166+255 in 8 bit register(d=255 or 0xFF).
Adding decimal 255 does not alter the actual value in eight bit register.
This is another way to implement NOP instruction, just to get a delay of one instruction cycle. addlw .255 can also be used to check mathimatical results in status register.
In a subrouitine
Code:
retlw 0	;the micro will return to wherever the sub-routine was called from

See delay section on this page,
http://www.talkingelectronics.com/projects/StartHere12F629/Library12F629_P1.html
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top