Using PIC and PWM to control LED brightness

Thread Starter

seng

Joined Aug 19, 2004
4
Hi,

Anyone know how to using PIC and PWM to control LED brightness?

How to interface to PC and writing a software program to control LED brightness?

Is using assembly language or PicBasic?

Thanks!!
 

Ah Pek

Joined Sep 20, 2004
2
Originally posted by seng@Sep 16 2004, 10:23 PM
Hi,

Anyone know how to using PIC and PWM to control LED brightness?

How to interface to PC and writing a software program to control LED brightness?

Is using assembly language or PicBasic?

Thanks!!
[post=2539]Quoted post[/post]​

Hi Seng,

Maybe you could try a PICAXE and some simple free software that is provided. Jump to this link ... http://www.picaxe.orcon.net.nz/

Ah Pek
 

manuka

Joined Jan 20, 2005
1
The Picaxe family ( there are now 8 of them !) are all based upon normal Pic micro microcontrollers, BUT have a bootstrap high level interpreter added by the clever UK marketers ( Revolution Education ). Such user friendliness amazingly comes at almost NO extra cost either ! Programming is ultra simple (2 resistors via a serial port ) & the Windows editor is FREE. Chip prices start at ~ US$3 for the current hottest Picaxe - an 8 pin " 08M ". Recommended !
There's a VERY helpful searchable forum => www.picaxe.com <=

Picaxes have been an electronics sensation especially in Australia/NZ ( thanks largely to a series of "Silicon Chip" magazine articles ) & users often manage more in a few hours that they'd have been able to in weeks otherwise. Code, in Basic Stamp style PBASIC, makes LED flashing etc almost trivial. Hence -

ledflash: ' simple LED flash routine for any Picaxe
High 1 ' turns output pin 1 on & lights attached LED
Wait 1 ' keeps in on 1 second
Low 1 ' turns output pin 1 off ( LED thus goes out)
Wait 1 ' keeps it off 1 second
Goto ledflash ' repeats procedure

Many powerful commands are inbuilt - EEPROM storage, DS18B20 reading, SONY style infra red decoding/encoding, PWM, interrupts , servos, sounds etc a breeze.

There are agents in Aus/NZ/Singapore etc, but global sales via Rev.Ed in UK are extremely fast ( although air freight can double cost if only a small order ) - I've had deliveries here to NZ in just 4 days . Go for them ! Stan. in NZ
 

vineethbs

Joined Nov 14, 2004
56
i hav dabbled arnd with pic16f84 for sometime , do u want some assembly code for doing pwm with 16f84 ? plz reply if u do
what i plan is this
u can input ur pattern (ie ur duty cycle etc on portb)
then that appears on one pin which can be used for driving the led
the pattern can be changed by an interrupt and then loading the new duty cycle etc ,interested ? ;)
 

cwarren

Joined Dec 14, 2004
3
Originally posted by vineethbs@Jan 24 2005, 09:19 PM
i hav dabbled arnd with pic16f84 for sometime , do u want some assembly code for doing pwm with 16f84 ? plz reply if u do
what i plan is this
u can input ur pattern (ie ur duty cycle etc on portb)
then that appears on one pin which can be used for driving the led
the pattern can be changed by an interrupt and then loading the new duty cycle etc ,interested ? ;)
[post=4774]Quoted post[/post]​

hi ....

i would b intrsted in looking at ur assembly code.
am wrking in a related project using LEds.
 

ELECTRONERD

Joined May 26, 2009
1,147
Maxim IC, Linear Tech, and many other companies have LED drivers with PWM built in. I'm not sure how you would adjust the brightness with the PWM but I'm sure it mentions it in each of the parts specs.
 
Top