Maker Pro
Maker Pro

LPC21xx Microcontrollers

pavankukkala

Mar 25, 2014
78
Joined
Mar 25, 2014
Messages
78
what is the use of watch dog timer & pulsewidth modulator in LPC21XX Microcontrollers
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
The watch dog timer is used to set a hardware interrupt when an expected future event has NOT occurred within the time allocated by the timer. This means if the event DOES occur, the program must reset or disable the watch dog timer to prevent the watch dog interrupt from occurring. This allows a program to recover from an endless "while loop" waiting for an event that never occurs.

The pulsewidth modulator allows multiple synchronized PWM outputs, typically used to control stepper motors, but also applicable to PWM communications. There is a nice "handbook," in PDF format, available here that describes the LPC21XX series of micro-controllers.
 
Last edited:

Anon_LG

Jun 24, 2014
453
Joined
Jun 24, 2014
Messages
453
These functions are not exclusive to the mentioned microcontrollers. The general uses for PWM are

Pulse width modulation: also referred to as PWM, this output provides rapidly oscillating voltage output, switching form a high voltage (in the case of these microcontrollers around 3 volts) to 0 volts, as a true analogue output is difficult to produce in the given space. The PWM is used in applications instead of an analogue signal such as LED dimming and motor speed control. The amount of time the output spends in high mode is referred to as the duty cycle, 1 time cycle of on and 1 time cycle of off would be a duty cycle of 50%.

I hope this helps you,
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Oh, yeah, I barely scratched the surface of PWM applications... and of course you don't really need a microcontroller; discrete components can be easily assembled into a working PWM application. Microcontrollers just make the control task relatively easy.

One area I have been investigating is electrosex stimulators, after my experience in physical therapy recovering from an arm broken in a motorcycle accident. The pulsed electrical muscle stimulation of my arm, along with the hot towels applied to it, felt quite wonderful. It might even have helped the healing process, although I read that the Russians did that by applying currents across the kniting bones. My orthopedic surgeon didn't want to try that.

So I surfed the web to see what was available for home use. You would not believe the kinky stuff I found! Here is a major cottage industry right under my nose just waiting for high-tech exploitation. I already had a little experience in this area (electrical muscle stimulation), having used in the 1970s a Grass stimulator on frog legs (from freshly sacrificed frogs) as an electronics technician assisting medical researchers and scientists. It didn't occur to me at the time that there might be other uses... or less expensive products.

Anyway, I hope this helps too. Imagine, an ARM processor used to build arm strength!
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
Oh, yeah, I barely scratched the surface of PWM applications... and of course you don't really need a microcontroller; discrete components can be easily assembled into a working PWM application. Microcontrollers just make the control task relatively easy.

I had done stuff using PDM, which is "sort of like PWM, but slightly different".

I am not sure if they are entirely interchangeable, as I suspect there may be cases where the receiving end expects a particular modulation, as opposed to a specific duty cycle.

I have also noted that there are some types of sensors which output something PWM-like, but the frequency varies rather than the duty cycle, which I have interpreted as being some sort of digital FM (say, it maintains an approx 50% duty cycle, but varies the output between around 700Hz and 1400Hz or so).


the biggest difference I have noted between PWM (mostly DPWM) and PDM (in software), is that PWM variants tend to use accumulators or arithmetic to determine the output state, whereas PDM tends to be driven by comparing the current output with the target value.

I have noted between comparing several algorithms, that PWM seems to work better at holding a particular duty cycle, but responds slower, whereas PDM variants seem to have better high-frequency response at the cost of not holding the target value as closely.

PWM tends also to more result in a variable square-wave output, whereas PDM will more often generate dithering in the output. also noted that PWM seems to under-compensate for changes in duty-cycle, whereas PDM seems to overcompensate.

one of the better compromises seemed to be a first-order delta-sigma modulator, which has a more uniform frequency response, and tends to generate output which looks more like PWM output.


One area I have been investigating is electrosex stimulators, after my experience in physical therapy recovering from an arm broken in a motorcycle accident. The pulsed electrical muscle stimulation of my arm, along with the hot towels applied to it, felt quite wonderful. It might even have helped the healing process, although I read that the Russians did that by applying currents across the kniting bones. My orthopedic surgeon didn't want to try that.

back when I was much younger (sometime in the late 90s IIRC), I remember hearing about some various "toys". one which I half remember (seeing talked about, probably on TV) was something for using a speaker-like voice-coil to essentially jerk-off the user (hands-free, using some sort of sock-looking thing). IIRC, it was designed use the audio output from a computer or game console (in-context, for pornographic FMV games, on the CD-i or something). also remember some stuff about "teledildonics" and similar.

I forget now where I saw it, and have not found any later evidence of any of this stuff having existed.

( well, among other things lingering in dark corners of my memory... )


So I surfed the web to see what was available for home use. You would not believe the kinky stuff I found! Here is a major cottage industry right under my nose just waiting for high-tech exploitation. I already had a little experience in this area (electrical muscle stimulation), having used in the 1970s a Grass stimulator on frog legs (from freshly sacrificed frogs) as an electronics technician assisting medical researchers and scientists. It didn't occur to me at the time that there might be other uses... or less expensive products.

Anyway, I hope this helps too. Imagine, an ARM processor used to build arm strength!

dunno about medical applications...


I have before imagined going the other way, mostly in the context of if people had powered armor or for controlling large robots. something similar is being done already for people controlling prosthetic limbs, which I guess is another noble goal.


possibly a person could also run A/V into their head, but for this, headphones and AR goggles could be a better solution.

dunno about a "good" solution for AR displays. past ideas had involved some use of conventional optics mixed with a combination of LCD and OLED displays (LCD for alpha blending, OLED for RGB).

an idea being to have an outer lens flatten the light, which passes through the display layers, and an inner lens reverses the effect of the first lens (and also has the display fill the users' field of vision).

on one extreme, they would be transparent like glasses, and on the other, would function more like VR goggles. in their normal mode of operation, they could allow overlays over ones' normal field of vision, and probably also have stereo cameras. also cool if they could function as welding and night-vision goggles.

they could also function sort of like the kinect, and allow the user to interact with the overlays using their hands or type with a virtual keyboard.

more conventionally, a person could have a VR headset with stereo cameras, but the drawback is that the user would have some amount of latency and reduction of dynamic range and resolution when it comes to their external vision.

well, and it could be annoying for those of us who have slightly abnormal color vision, and where cameras/monitors see the world a bit differently than ones' eyes (colors generally "look different", and the world cameras see looks dull and desaturated, and some colors I can see IRL seem to not exist on computers, *).

*: particularly near the blue end of colors. what many people collectively call "blue" I see as several different looking colors, and where pure blue on a computer is more of a violet-looking color. if a computer sees cyan, it just sort of mixes blue and green, but this doesn't really look much like what I see IRL (no good way to describe it exactly, but it looks "different").

basically, there is "blue" in the sense of cyan or sky-blue, which I see as "different looking" colors IRL. then there is another "blue" which looks more indigo or violet, which is what computers see. and, of course, there is green. green+blue (indigo) doesn't match the other color.

red/yellow/green look about the same though in both cases (this part of the rainbow matches).
 
Top