wwatson4506 / Ra8876LiteTeensy

Teensy RA8876 Driver
14 stars 7 forks source link

Add a simple command for back light brightness (0 -> 255) #18

Closed sbfreddie closed 3 months ago

sbfreddie commented 3 months ago

The RA8875 has a very simple command to set the back light brightness from 0 to 255. Why did you not implement a simple back light brightness command?

Thanks, Ed

wwatson4506 commented 3 months ago

Are you speaking of the RA8875 or RA8876 device?

sbfreddie commented 3 months ago

I am speaking of the RA8876 using the RA8875 as an example.

Ed

wwatson4506 commented 3 months ago

If RA8876 then check out the beginning of the setup function in the "graphics.ino" sketch.

sbfreddie commented 3 months ago

WW: I already saw that, but I know this chip has the built-in ability to dim the back light built into it, just like the RA8875 does. Why did you not implement this ability from the beginning, as it is a very worthwhile and useful command? I seem to remember that one of the other guys working on this library did it to his display with a simple change of jumpers on the RA8876 board.

Thanks, Ed

wwatson4506 commented 3 months ago

I am working on another project right now and do not have the time right now to research it...

On Thu, Apr 11, 2024 at 9:21 AM Ed @.***> wrote:

WW: I already saw that, but I know this chip has the built-in ability to dim the back light built into it, just like the RA8875 does. Why did you not implement this ability from the beginning, as it is a very worthwhile and useful command? I seem to remember that one of the other guys working on this library did it to his display with a simple change of jumpers on the RA8876 board.

Thanks, Ed

— Reply to this email directly, view it on GitHub https://github.com/wwatson4506/Ra8876LiteTeensy/issues/18#issuecomment-2050062305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2Q7WFK5QFXDTNBGXBFKTY422A5AVCNFSM6AAAAABGCSTQKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQGA3DEMZQGU . You are receiving this because you commented.Message ID: @.***>

wwatson4506 commented 3 months ago

Ed - While working on the project that involves the RA8876 display I happened across this: //**// // Turn Backlight ON/Off (true = ON) //**// void RA8876_t3::backlight(boolean on) {

if(on) { //Enable_PWM0_Interrupt(); //Clear_PWM0_Interrupt_Flag(); //Mask_PWM0_Interrupt_Flag(); //Select_PWM0_Clock_Divided_By_2(); //Select_PWM0(); pwm_ClockMuxReg(0, RA8876_PWM_TIMER_DIV2, 0, RA8876_XPWM0_OUTPUT_PWM_TIMER0); //Enable_PWM0_Dead_Zone(); //Auto_Reload_PWM0(); //Start_PWM0(); pwm_Configuration(RA8876_PWM_TIMER1_INVERTER_OFF, RA8876_PWM_TIMER1_AUTO_RELOAD,RA8876_PWM_TIMER1_STOP, RA8876_PWM_TIMER0_DEAD_ZONE_ENABLE, RA8876_PWM_TIMER1_INVERTER_OFF, RA8876_PWM_TIMER0_AUTO_RELOAD, RA8876_PWM_TIMER0_START);

pwm0_Duty(0xffff); <------------- Looks like all that is needed is a supplied argument here instead of 0xffff here. 

} else { pwm_Configuration(RA8876_PWM_TIMER1_INVERTER_OFF, RA8876_PWM_TIMER1_AUTO_RELOAD,RA8876_PWM_TIMER1_STOP, RA8876_PWM_TIMER0_DEAD_ZONE_ENABLE, RA8876_PWM_TIMER1_INVERTER_OFF, RA8876_PWM_TIMER0_AUTO_RELOAD, RA8876_PWM_TIMER0_STOP);

}

} I do not have a working system setup right now so I can't test this.

sbfreddie commented 3 months ago

WW: Thanks, I saw that and came to the same conclusion as you did.

I am closing this now. Thanks, for all your help. Ed

leutholl commented 1 month ago

Have a look at my library here: https://github.com/leutholl/TFT0784_mm where full backlight control is implemented including any values between 0 to 100% using RA8876 PWM