Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Jim Granville
06/12/12 22:51
Read: 534 times

#187688 - Advice on what ?
Responding to: ???'s previous message
Martin Eliáš said:
... coming from Czech Republic to you for the advice :)

LED PWM is interesting on a 89S52.

Has your Prof defined any resolution, and PWM repeat frequencies ?
Does he want 0% and 100% levels as DC ?
What about PDM (Pulse Density Modulation) ? Google CD4089

There are many ways to tackle this, depends on what matters :

In a 89S52 you could fit 4 channels of 256 play-back booleans into the upper 128 bytes of RAM. ( == 4 LEDs).
Opcode here is MOV A,@Ri
You can cover many modulation schemes here and even hide/embed data in the LED modulation, so you can send status info.

Or, you can use CJNE/DJNZ opcodes in multiple ways, to give 2/3/4/n channels of PWM timing.

All systems will have a fast interrupt, maybe 10-40KHz region, that check each time slot for Pin == On or Off.

With careful crafting you might even avoid needing to push/pop anything in your fast interrupt.

List of 9 messages in thread
AT89S52 - PWM RGB LED Control      Martin Eliáš      06/12/12 12:17      
   a couple of notes      Erik Malund      06/12/12 13:54      
   Where are you stuck?      Per Westermark      06/12/12 13:59      
   Advice on what ?      Jim Granville      06/12/12 22:51      
   Your reset scheme is unsuited...      Kai Klaas      06/13/12 06:18      
      good tutorial      Martin Eliáš      06/13/12 07:33      
         9V rechargable alkaline battery?        Per Westermark      06/13/12 08:06      
            Definitely Primary!      Andy Neil      06/15/12 12:52      
               going by the instructions ...      Erik Malund      06/15/12 14:10      

Back to Subject List