Check into Don Lancaster's Magic Sinewaves here: http://www.tinaja.com/
I did it with a basic stamp BS1 several years ago when I was a newby, it is quite simple and works great.
Check into Don Lancaster's Magic Sinewaves here: http://www.tinaja.com/
I did it with a basic stamp BS1 several years ago when I was a newby, it is quite simple and works great.
Hi,
Attached is an Excel spreadsheet showing an examle of a 72 steps/cycle SIN table with an 8bit dutycycle. You can modify it for any number of steps and resolution you see fit or you may want to create one half cycle and then have your code invert it for the second half and so on - it's up to you.
To get three phases there's no need to have three tables, you use three pointers 120° appart indexing the same table. So, with the table in the attached .xls you start at steps 0, 24 and 48 respectively.
/Henrik.
EDIT: Crap, can't attach the .xls here. Send me a PM with your email adress and I'll send it to you.
Add ".txt" to the extension...EDIT: Crap, can't attach the .xls here. Send me a PM with your email adress and I'll send it to you.
Dave
Always wear safety glasses while programming.
Ahh, OK, should've thought about that.
So, here it is - remove the .txt extenstion and open with Excel or compatible.
/Henrik.
Hello sangaboy,
1) Download the file then rename it SIN-table.xls (or whatever ending with .xls) then open it with EXCEL 2003 - or compatible software. I just tried that here and it works fine. If you don't have Excel 2003 perhaps you can find a free viewer or converter online.
2) The first code snippet you posted is a setup section of DT-Ints which are a set of files making interrupts with PBP a whole lot easier. The second code snippet sets up TMR1 to operate in a specific way and then preloads it with 65534 (which seems a bit strange) but that's what you get when you just copy code. You really need to start a bit further back here. Before taking on a project a like a 3-phase inverter you need to understand the basics of PIC and PBP - at least. How the timers work, how interrupts work and so on.
Read up on the DT-Ints routines, there are several threads on this forum. Read up on how TMR1 operates, there's a lot of info in the datasheet and a bit of searching here will give a lot, I mean a LOT, of usefull information and examples. Start small otherwise you'll never learn how it works.
If you get stuck ask specific questions regarding the particular task at hand and tell us what the actual problem is and what you've tried, post the code and so on.
I really don't want to sound like a smart-ass but if you can't figure out the formula to create a SIN-lookup table then designing and programming a 3-phase inverter drive is going to quite a challange.
Hii! to all
I read DT-Ints routines from ttp://darreltaylor.com/DT_INTS-14/order.html here are some problems I faced any one can help me.
(1)the difference between PBP AND ASM interrupt handler is not clear to me.
(2) what the effects of ResetFlag on this code definition.
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
Thankx
Thankx again HenrikOlsson here are some things which I dont understand I ask for the help from any one
(1) ask for the help again which formula should I use to generate this sine look up table I need some detail on it thankx.
(2) and how this portion of code work , what is function, and how to get values of TMR1L AND TMR1H
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _sine, ASM, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
T1CON = 000001 ; Prescaler = 8, TMR1ON
TMR1L = 255
TMR1H = 254
@ INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts
Bookmarks