I ended up doing just that. What I was looking for was something on the lines of: ---------------------------------- (make sure to TRIS port C,2 as an output) ;------------------------------ SETUP PWM -------------------- MOVLW B'11111111' ;SET PERIOD OF PWM MOVWF PR2 MOVLW B'11111111' ;SET DUTY CYCLE (127 DEFAULT) MOVWF CCPR1L MOVLW B'00001111' ;SET OTHER CONFIG OF PWM MOVWF CCP1CON MOVLW B'00000100' MOVWF T2CON ;WRITE TO T2CON ---------------------------------- Yes, I know my 'default' isn't the same as this setting. While my default dim setting is 127, I started at 255 to start the backlight off then 'ramp it up' while the boot sequence is underway. Yes, I like little tricks like that. :-) But, my backlight dim function is working perfect now. I did take a shortcut which I will detail in my next email (provided you didn't see it above) Joe M. Jan-Erik Soderholm wrote: > MCH wrote: >> Maybe I'm getting too specific here. Let's make the net larger. >> >> Does anyone have an example of "working" ASM code that will configure >> and output PWM signals? >> > > Yes, the datasheet for the specific part. There usualy is a > 1-2-3 guide on howe to configure the PWM module. You *are* > talkig about the *hardware* PWM module, right ? > > >> All I can find on the net is BASIC or C language. >> > > Since it's mainly a questions about setting up a few registers > correctly, it would/should be easy to do the same thing as the > BASIC or C examples do, but in ASM instead. > >> I found one great tutorial site that says it has a section on PWM, but >> "PWM" is not mentioned once in their tutorial. :-\ >> >> I also tried looking for app notes on the Microchip website. So, if >> anyone knows of a URL for that, it would greatly help as well. >> >> Again, just looking for a 'how to' with code examples of ASM code for >> the PWM output. It doesn't matter what is being controlled with the >> output. >> >> I'm using an 18F4520, > > OK, then. Chapter 15.4.4 "SETUP FOR PWM OPERATION" on page 145. > It's 5 steps, 1 to 5. It's not actual code, but it says which > register to set to what. If you can't translate that into ASM, > well, then you have other issues to fix first. > >> but any ASM code would be appreciated, as I'm sure I could translate it. >> >> > > If you want ASM code, why "translate" ASM code that you get ? > > >> Thanks, Joe M. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist