As i am using a RL78 micro controller , i need a C code for controlling the brightness of a led.i have searched in the internet ,but of no use.... only some datasheets are provided.There is no exact calculation of duty cycle for PWM also,if anyone is familiar with calculations and code please help.I have used many resources but none was useful.
Asked
Active
Viewed 851 times
-3
-
Can you post a link to the data sheet? For example, on the Microchip PIC chips I use (ie: PIC32mx795F512L), they have these massive product manuals that are about 500 pages for a single chip. They have a thorough description of how to set up and use PWM, usually via the output compare (OC) interrupt handler. http://ww1.microchip.com/downloads/en/DeviceDoc/61156H.pdf – Cloud Jun 17 '14 at 16:25
-
Are you connecting the DAC output to the LED's anode and a resister to ground to the LED's cathode? – Fiddling Bits Jun 17 '14 at 17:40
-
1@FiddlingBits : He's suggested that he's using the PWM (which is more appropriate for LED control). The RL78 product selector does not have any parts with a DAC in any case, whereas they all have at least 32 PWM outputs and as many as 21. – Clifford Jun 17 '14 at 20:35
1 Answers
1
The datasheet is not the place to look for such information - for most micros that is little more than a summary for the purposes of part selection and circuit design. You need to be looking (in this case) at the User's Hardware Manual - other manufacturers use other names, but not datasheet. You have not fully specified the part you are using so it is not possible to direct you, but for example the RL78/1A hardware manual has:
Note that there is much more documentation and application notes on the manufacturers web-site - select your part and clock the Documentation tab.
The even have a driver code generator tool that may even write the code for you. A quick look at the documentation for that suggests it will.

Clifford
- 88,407
- 13
- 85
- 165
-
Note, I have never used (or even previously heard of) RL78, so can help you no further, I'm just pointing to what is in plain sight. – Clifford Jun 17 '14 at 20:28
-
son vendors use the term datasheet for pin info and register/programming info, some use the datasheet just for pin/power info and some flavor of users guide or programmers reference. i wouldnt say or agree that most. maybe most or all within this product line sure... – old_timer Jun 18 '14 at 01:03
-
@Clifford : Thanx for the info...!!But with this info also i cant move on. – user3749242 Jun 23 '14 at 15:19