OK, I'm getting a decent grasp on this project, and I'm narrowing down how I'm doing it. What I plan on doing is running all of my LED circuits from a UART signal, rather than having some feed directly off the main circuit. This should simplify it so that I'm not having different ways of doing things within the same system.
I'm going to have a simple control circuit that will only send out a signal if a setting is changed, or if a module requests information (I think this should be fairly simple to set up).
For the PWM, I think I'll stick to the chip with the PWM function built in, due to the 5 channels I want to run. However, if I were to use something like a 12F675, and I ran a simple software PWM program, how high could I expect the PWM frequency to be with 5 channels of output?
---------- Post added at 08:20 ---------- Previous post was at 08:11 ----------
Cant really answer 1 as I dont get the question, and I've never used microchips on board pwm, is it single or multi channel?
Sorry, I forgot to respond to this when you posted it. Here is the section of code from the Microchips website example of using CCP2 as a PWM operation. This is the setup portion:
;Set up PWM module
;Set PWM period by writing to PR2
;Set PWM duty cycle by writing to the CCPR2L register
; and the CCP2CON<5:4>>bits
;Make the CCP2 pin an output by clearing the TRISC<2> bit.
clrf CCP2CON ;CCP module is off
bsf CCP2CON, CCP2M3 ;select PWM mode
bsf CCP2CON, CCP2M2 ;select PWM mode
movlw 0x3F ;Set PWM frequency to 78.12kHz
movwf PR2 ;
bcf TRISC, 1 ;make channel 1 an output
movlw 0x00
movwf CCPR2L
I was slightly confused by "movlw 0x3F, because the hex value translates to 63, but it says this sets the frequency at 78.12. If I am to understand how to control this, I need to understand the correlation between the numbers.