Searching \ for '[SX] SX28 and PWM' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/lib/io/index.htm?key=pwm%2Finde+pwm
Search entire site for: 'SX28 and PWM'.

Exact match. Not showing close matches.
PICList Thread
'[SX] SX28 and PWM'
2008\03\19@162501 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Could someone just verify that the PWM output is just plain-old regular PWM (you know, a square wave with varying duty-cycle)?  I know this is a stoopid question, but most of the examples I have looked at on the web are using PWM to create analog voltages.  I just want to drive a MOSFET for a simple dc motor controller.

Larry
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\19@172204 by Sparks-R-Funn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote:

Larry,
  The SX/B PWM command is intended for use in creating analog output voltages.  For example, with a 50% duty cycle setting the result is a stream of high and low pulses of equal durations during the time interval specified.  If you want to control the speed of your motor this might work for you.  However, if you want to create just a single pulse output (which you can repeat to make a pulse stream) where you determine how long the pulse is high and how long it is low you will probably want to use the PULSEOUT command instead.  
  The PULSEOUT command will create a pulse with a single transition within the time period specified.  The PWM will likely generate many transitions during the time period specified.

Example outputs where H = HIGH, L = LOW
--------------------------------------------------
PULSEOUT: HHHHHLLLLL at 50%
PWM: HLHLHLHL at 50%

NOTE:  The SX48 has two internal timers you can use to set up two pulse streams in hardware that continue to run on their own once configured.  These are very nice for motor control!  If you are using an SX48 be sure to consider them!


I hope this helps.

- Sparks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258545
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\19@182708 by robotworkshopn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, robotworkshop wrote:

The SX48 timers do work well for motor control.  There is an article in next months SERVO which uses an SX48 to control a motor and use an encoder for closed loop control.  It worked out great!

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258562
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\20@153707 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Ohhhhh.  Boy, am I a doofus.  I had it in my mind that once I issue a PWM command (via SX/B) that the chip would output a continuous stream of pulses whose duty cycle and period were determined by the parameters to the function.  What you really get is one pulse. D'Oh. You have to put the code in a loop to get a continuous stream (right? he asks sheepishly).  
Here's what I want to do and it's real simple: Footswitch depresses and motor goes fast.  Press again and motor goes slow.  This action will toggle between fast and slow until the footswitch is held for more than 2 seconds. At this point, the motor goes off.  I'm trying to simulate the action of my Leslie 2101 Treble unit (you know, the speaker that rotates).  I made a bass unit with a rotating drum, but the ac motor is single-speed.  I would like to convert the motor to a dc motor and adjust the speed via a pwm system.  Since I already coded the footswitch in SX/B to light LEDs for fast and slow and off, I was hoping to just add some pwm code to drive a MOSFET and a motor.

I bought a couple of IRF510s and couple of heatsinks (I only need one - I'm not making an H-bridge) and I'm ready to burn something out <g>.  Luckily everything I'm playing with is cheap. And no, I don't have the final motor yet.  All I have is a Radio Shack hobby motor for testing.

Larry
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258764
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\20@161142 by beann/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

Larry,
 There are a couple options.
 One would be to use the SX48 timers.
 Another would be to create an interrupt driven PWM routine (this is fairly easy).

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258768
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\20@174129 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Bean, I think I finally get the whole pwm thing.  Hopefully I didn't embarass myself too badly in my posts .  So, it's on to Plan B: Dual 555 as pulse-width modulators - one for the fast speed and one for the slow.  I'll use the i/o pins from my footswitch controller to switch the speeds through logic gates.  This is actually a better approach because I can trim the speeds with small pots.

Thanks to everyone who replied.

Larry
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258776
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\21@013208 by g_daubachn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote:

Larry,
I've got a vintage Leslie 122 here (together with a Hammond B3), and I also was thinking to replace the old two-speed AC motor units by something new in the future. I did some testing with brushless DC motors available from Papst, a German company. These motors come with integrated driver electronics, and their speed can be controlled over a wide range by applying a DC voltage from 0 to 5V to an input.

Although these motors are way more expensive than simple hobby motor, there is no need for any gears, or capstan drives as on the olt original units, and these motors are very silent.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258811
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\21@133022 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

Larry,
It's pretty easy to create "background" PWM with an interrupt -- that would save you the trouble of external circuitry.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258947
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\21@170842 by g_daubachn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote:

Larry,
as JonnyMac said, PWM signals can be generated with any type of SX using a timed interrupt. The "larger" SX48 offers the additional "luxury" of two multi-purpose timers/counters that can be configured to generate PWM output. Nevertheless, the "smaller" SXes are powerful enough to generate one or more PWM signals with an interrtupt routine.

For one of my commercial applications, I'm using an SX28 to generate three independent PWM outputs for controlling three DC motors. This design works "rock-solid", and there are over 800 units out in the field so far. So why using 555s and logic gates - the SX can handle all the tasks you are looking for - PWM, and reading the footswitches.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258988
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\22@110654 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Ok, Gunther and JohnnyMac, I'm game.  Where do I start?  I'm a novice (albeit an 53-year-old one ).  I'm ok with interrupts in general - my first cut at the footswitch code was interrupt-driven.  However, I simplified it with loops.  I also had issue with the ISR not being able to access my subroutines because they were outside of the first page ("address 260 is not in the lower half of the page" message).  When I made a looping model, no more page alerts.  This kind of scared me away from interrupts.  But... I'd rather not have to build the pwm circuitry if I don't have to.

And can I do it with SX/B instead of SASM?  I've lost my assembly-language skills way back in 1980 when I learned 'C' .

Larry
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259130
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\22@131807 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

Sure.  Tell me what pins you want your PWM on and what the PWM frequency should be and I'll whip up a little program -- no assembly required -- that will take care of it for you.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259146
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\22@133251 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Ok. Any pin will do - how about rb.0?  And as far as the pwm frequency goes... when controlling a motor, should the frequency be above the audible range? I've seen controllers put out at 15KHz, 9KHz, and some at 250Hz.  Since you have more experience with motor control than I do (pardon my assumption), choose what's best.  I forgot what the Motor Mind B does, but I believe it's above the audible range.

Thanks again.

Larry
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259149
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\22@134905 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

Have a look at the program I've attached.  I used an ISR rate that will give you a PWM frequency of 600 Hz and allow for the addition of ISR-based transmit and receive should you want to add that later.  If you don't, you can always bump the ISR rate (remember, the PWM takes 256 ISR cycles).

When using interrupts in SX/B any time-based processes are affected; you'll see that this example has a replacement for PAUSE that uses cycles through the interrupt for timing.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259152
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\22@191111 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Gadzooks, I've lost my 20MHz resonator.  All I've got is the 4MHz one.  Also, Jon, could you give a quick overview of how the whole thing works.  To me, it's tricky to understand at first glance.  And after I figure it out, maybe I can modify it to work at 4MHz.

L
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259189
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\23@102810 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

It's actually pretty simple: there is a timer that reloads a PWM accumulator every 256 cycles (when the time rolls over from 255 to 0).  After the accumulator is loaded with the desired duty cycle (0 to 255 = 0 to 100%).  When not doing a reload cycle the accumulator is incremented and when it rolls over the output is set high, so the higher your duty cycle, the earlier the accumulator rolls over and the quicker the output goes high.

I actually found a small error (I just got home from a trip and have my scope packed -- sorry).  Give the version attached to this message a try.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259277
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\23@123615 by lmoltern/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, lmolter wrote:

Jon, I thought something was amiss because I stuck a LED on the motor port and it lit up once and never went out.  The new code works as I expected it should. And thanks for the explanation.  I'll stare at the code a little and try to figure out how to integrate the footswitch (on my own ).

By running at 4MHz instead of 20, the ISR is still run 153000 times per second, but all the other timing is off, right?  The one second pauses are now 5 seconds (of course).  So did the pwm frequency go down to 100Hz then?  Doesn't really matter, I guess.  And I think I'm getting a scope on Monday (a real Tektronix (sp?), not a usb).  That'll help me make sense of it all.

Thanks again,
Larry
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259314
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)

2008\03\23@140249 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

At 4MHz you are missing interrupts, hence the apparent change in speed.  If you have an SX-Key you can let the Key generate the clock and see the timing work correctly.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259323
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)


'[SX] SX28 and PWM'
2009\02\16@130320 by ken261n/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, ken261 wrote:

JonnyMac,
Sorry to resurrect an old thread, but this is my first post here and I'm not sure how else to ask directly about this code of yours..
I works well, but I have two questions:
1. Why do you use the DELAY_MS subroutine?

2. Would it be possible to incorporate SPI into this ISR?

My SX28 is going to be a slave device running 50MHz, and I want to send duty cycle (as well as other commands) via SPI
Thanks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m329044
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\02\16@144431 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

1. When using interrupts time-oriented routines like PAUSE get hammered; DELAY_MS uses interrupt timing to create a delay
2. I'm sure it is but I've never done it (I'll bet my pal, Gunther, has).  Why use SPI?  Can you use serial? -- easier to implement (one wire versus 3) and many of use have a lot of code that is ready to use.  Bean has done some work turning the SX into an SPI slave -- you might do a search.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m329059
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\02\16@155211 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

I've attached a serial example.  This uses the Parallax AppMod protocol and is configured so that the device can have an address of %00 to %11 and a selectable baud rate (2400 or 38.4k -- matches the PSC).  Communications with the host (e.g., BASIC Stamp, another SX) is Open-True mode serial; bi-directional half-duplex over one wire.  The project is a simple 8-channel LED controller (PWM).  Note that this style PWM is variable frequency based on duty cycle.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m329073
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\02\17@052803 by ken261n/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, ken261 wrote:

Thanks,
The reason for SPI is that I have an entire bus of various devices (digital pots, 14bit ADCs, etc) that are all being controlled via USB --> SPI.
I am integrating the PWM and digital I/O capabilities of the SX as a further development (without starting from scratch).

I think I had found that SPI code, but thank you.  I will try my hand at integrating the two into one interrupt unless this seems like something good for TASKs.
My PWM cycle is only 60 Hz, so accuracy should be easy to attain.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m329225
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\02\17@083044 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

There's SPI code demos (master and slave) on this page: http://www.parallax.com/tabid/460/Default.aspx
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m329257
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...