Forums

Assembler Code Question

Started by Unknown July 16, 2013
Would anyone here be willing to have a look, maybe off-list, at an
Assembler routine that was written for me several years ago?

It is a five channel sinewave generator using LUT's on a PIC micro. 

I am not a coder, but need to know how to make changes in stp1hi EQU
and stp1lo EQU values in order to derive different frequencies.

I also would like to know the definition of a "PWM factor" is, and how
it relates to the above process.

Otherwise, is there a good online forum specifically for Assembler?
Can't seem to find a very active one.

Ken Rockwell
On 16/07/2013 4:37 PM, krockwell@imagenet.com wrote:
> > Would anyone here be willing to have a look, maybe off-list, at an > Assembler routine that was written for me several years ago? > > It is a five channel sinewave generator using LUT's on a PIC micro. > > I am not a coder, but need to know how to make changes in stp1hi EQU > and stp1lo EQU values in order to derive different frequencies. > > I also would like to know the definition of a "PWM factor" is, and how > it relates to the above process. > > Otherwise, is there a good online forum specifically for Assembler? > Can't seem to find a very active one. > > Ken Rockwell >
Ken, if you don't have any success here, try posting on the microchip tech forums. Lots of clever & helpful guys there. You need to register to post, easily done though. http://www.microchip.com/forums/
On Tue, 16 Jul 2013 18:37:29 +1000, krockwell@imagenet.com wrote:

> >Would anyone here be willing to have a look, maybe off-list, at an >Assembler routine that was written for me several years ago? > >It is a five channel sinewave generator using LUT's on a PIC micro. > >I am not a coder, but need to know how to make changes in stp1hi EQU >and stp1lo EQU values in order to derive different frequencies. > >I also would like to know the definition of a "PWM factor" is, and how >it relates to the above process. > >Otherwise, is there a good online forum specifically for Assembler? >Can't seem to find a very active one.
Try asking over in comp.arch.embedded. Perhaps stp1h1 and stp1lo are constants that define the on- and off-time for a "pulse width modulator" (PWM). Changing those, if that's what they are, would change the length (period) and duty cycle of a square wave signal. A 50% duty cycle wavetrain could be passed through an analog filter to remove all but the fundamental sine wave (for some definitions of "all"). An approach that needs less filtering is "direct digital synthesis" (DDS) which sounds fancy but really is nothing more than a look-up table, an accumulator, and frequency-determining factor that gets added to the accumulator at periodic intervals. The accumulator is then used to index into the look-up table. If the code has a look-up table that defines a complete, half, or quarter cycle then I'd guess you're looking at a DDS. Not sure where PWM would be needed in that case, though.
krockwell@imagenet.com wrote:
> > Would anyone here be willing to have a look, maybe off-list, at an > Assembler routine that was written for me several years ago? > > It is a five channel sinewave generator using LUT's on a PIC micro. > > I am not a coder, but need to know how to make changes in stp1hi EQU > and stp1lo EQU values in order to derive different frequencies.
You can use any old text edit program to make the change. You then need to create a new binary using an assembler (ie the one that comes with Microchip's MPLAB). Then you need to use a tool similar to "PicKit 2" to copy the new binary into the device.
> I also would like to know the definition of a "PWM factor" is, and how > it relates to the above process.
That's a good question. Pulse Width Modulation varies the width of a pulse in same manner that Frequency Modulation varies the frequency of a wave. A search of "PWM factor" causes "Power Factor" to jump out at me. If it's the case that "PWM factor" is short hand for "PWM Power Factor" then possibly the intention is to vary the Power Factor proportional to the Pulse Width. Perhaps to add capacitance to compensate for inductive loads.
> Otherwise, is there a good online forum specifically for Assembler? > Can't seem to find a very active one.
Your question may be more of a PIC question than an Assembler question. MIT's Piclist is the best place for PIC questions. It's a standard mail list. See http://www.piclist.com/techref/piclist/index.htm#quickfaq Here's a synopsis of how it works. Prefix your subject line with [PIC]. Email your question to piclist@mit.edu. (IIRC Piclist is moderated.) Read the responses (if any) to your question by clicking on "Today" at http://www.piclist.com/techref/postbot.asp -- Don Kuenz
On Tue, 16 Jul 2013 18:37:29 +1000, krockwell@imagenet.com wrote:

> >Would anyone here be willing to have a look, maybe off-list, at an >Assembler routine that was written for me several years ago? > >It is a five channel sinewave generator using LUT's on a PIC micro. > >I am not a coder, but need to know how to make changes in stp1hi EQU >and stp1lo EQU values in order to derive different frequencies. > >I also would like to know the definition of a "PWM factor" is, and how >it relates to the above process. > >Otherwise, is there a good online forum specifically for Assembler? >Can't seem to find a very active one. > >Ken Rockwell
Try the microchip forums or I've found the 'PIC list' to be very usefull. But usually there is a LUT with SIN values for a sine wave. These are written to the PWM module at a rate that determines the frequency. Cheers
<krockwell@imagenet.com> schreef in bericht 
news:to0au8hir2miojhgd5gns46aetlirneukj@4ax.com...
> > Would anyone here be willing to have a look, maybe off-list, at an > Assembler routine that was written for me several years ago? > > It is a five channel sinewave generator using LUT's on a PIC micro. > > I am not a coder, but need to know how to make changes in stp1hi EQU > and stp1lo EQU values in order to derive different frequencies. > > I also would like to know the definition of a "PWM factor" is, and how > it relates to the above process. > > Otherwise, is there a good online forum specifically for Assembler? > Can't seem to find a very active one. > > Ken Rockwell
Where's that routine? Did I miss it, did my newsserver miss it or didn't you provide it? petrus bitbyter
On Tue, 16 Jul 2013 18:37:29 +1000, krockwell wrote:

> Would anyone here be willing to have a look, maybe off-list, at an > Assembler routine that was written for me several years ago? > > It is a five channel sinewave generator using LUT's on a PIC micro. > > I am not a coder, but need to know how to make changes in stp1hi EQU and > stp1lo EQU values in order to derive different frequencies. > > I also would like to know the definition of a "PWM factor" is, and how > it relates to the above process. > > Otherwise, is there a good online forum specifically for Assembler? > Can't seem to find a very active one. > > Ken Rockwell
As mentioned, try posting on comp.arch.embedded. Actually including the listing, if it's no more than 40 lines or so (or better, less than 10) will help. I only do that kind of stuff for pay -- picking through code is WORK! But you might get lucky with one of the comp.arch.embedded guys. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On 2013-07-16, krockwell@imagenet.com <krockwell@imagenet.com> wrote:
> > Would anyone here be willing to have a look, maybe off-list, at an > Assembler routine that was written for me several years ago? > > It is a five channel sinewave generator using LUT's on a PIC micro. > > I am not a coder, but need to know how to make changes in stp1hi EQU > and stp1lo EQU values in order to derive different frequencies. > > I also would like to know the definition of a "PWM factor" is, and how > it relates to the above process. > > Otherwise, is there a good online forum specifically for Assembler? > Can't seem to find a very active one. > > Ken Rockwell
I'm guessing stp1hi and stp1lo are high and low bytes (words?) for the DDS phase accumulator step size. PWM factor possibly controls the amplitude of the modulation. -- &#9858;&#9859; 100% natural --- news://freenews.netfront.net/ - complaints: news@netfront.net ---