Smooth LED fading via PWM


Closed Thread
Results 1 to 40 of 55

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: Smooth LED fading via PWM

    For any N-Channel small MosFet needs (up to 2A) have a look at the Si2308 too. It is working fine from 4.5 Volts with Rds of 0.192 and Id of 2.1 Amp.


    And the best P-Channel Power Mosfet I have find maybe is the SUM110P04-05-E3. Usually the P-channel have high Rds and low Id specs.

    Ioannis

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Smooth LED fading via PWM

    actually, I was mistaken the RDS of my Mosfet is about 0.7 Ohms.

    I bought these P channel Mosfets when CPC Farnell were clearing them out for about 5p each...

    http://www.farnell.com/datasheets/468737.pdf

    I think I bought about 100 ....I couldn't believe it when they arrived...every Mosfet was sealed individually in a 5cm plastic bag, & then inside the plastic bag, each MOSFET was then sealed in it's SMD wrapping! It takes me more time to get to the mosfet than to make my PCB!

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Smooth LED fading via PWM

    Ok, I missing somethinh fundamental here...wondering if anyone can embarrass me!

    I'm putting some data into eeprom...
    Code:
    data  0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, _
    1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, _
    2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4, _
    4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,8,8, _
    8,8,8,8,9,9,9,9,10,10,10,10,10,11,11,11,11,12,12,12, _
    13,13,13,13,14,14,14,15,15,15,16,16,16,17,17,18,18,18, _
    19,19,20,20,20,21,21,22,22,23,23,24,24,25,26,26,27,27,28, _
    29,29,30,31,31,32,33,33,34,35,36,36,37,38,39,40,41,42,42, _
    43,44,45,46,47,48,50,51,52,53,54,55,57,58,59,60,62,63,64, _
    66,67,69,70,72,74,75,77,79,80,82,84,86,88,90,91,94,96,98, _
    100,102,104,107,109,111,114,116,119,122,124,127,130,133,136, _
    139,142,145,148,151,155,158,161,165,169,172,176,180,184,188, _
    192,196,201,205,210,214,219,224,229,234,239,244,250,252
    note that last value 252....ok, when I read out the contents of eeprom...

    Code:
    Loc000: 000
    Loc001: 001
    Loc002: 001
    Loc003: 001
    Loc004: 001
    Loc005: 001
    Loc006: 001
    Loc007: 001
    Loc008: 001
    Loc009: 001
    Loc010: 001
    Loc011: 001
    Loc012: 001
    Loc013: 001
    Loc014: 001
    Loc015: 001
    Loc016: 001
    Loc017: 001
    Loc018: 001
    Loc019: 001
    Loc020: 001
    Loc021: 001
    Loc022: 001
    Loc023: 001
    Loc024: 001
    Loc025: 001
    Loc026: 001
    Loc027: 001
    Loc028: 001
    Loc029: 001
    Loc030: 001
    Loc031: 002
    Loc032: 002
    Loc033: 002
    Loc034: 002
    Loc035: 002
    Loc036: 002
    Loc037: 002
    Loc038: 002
    Loc039: 002
    Loc040: 002
    Loc041: 002
    Loc042: 002
    Loc043: 002
    Loc044: 002
    Loc045: 002
    Loc046: 002
    Loc047: 002
    Loc048: 002
    Loc049: 002
    Loc050: 003
    Loc051: 003
    Loc052: 003
    Loc053: 003
    Loc054: 003
    Loc055: 003
    Loc056: 003
    Loc057: 003
    Loc058: 003
    Loc059: 003
    Loc060: 003
    Loc061: 003
    Loc062: 003
    Loc063: 004
    Loc064: 004
    Loc065: 004
    Loc066: 004
    Loc067: 004
    Loc068: 004
    Loc069: 004
    Loc070: 004
    Loc071: 004
    Loc072: 004
    Loc073: 004
    Loc074: 005
    Loc075: 005
    Loc076: 005
    Loc077: 005
    Loc078: 005
    Loc079: 005
    Loc080: 005
    Loc081: 005
    Loc082: 006
    Loc083: 006
    Loc084: 006
    Loc085: 006
    Loc086: 006
    Loc087: 006
    Loc088: 006
    Loc089: 007
    Loc090: 007
    Loc091: 007
    Loc092: 007
    Loc093: 007
    Loc094: 007
    Loc095: 008
    Loc096: 008
    Loc097: 008
    Loc098: 008
    Loc099: 008
    Loc100: 008
    Loc101: 009
    Loc102: 009
    Loc103: 009
    Loc104: 009
    Loc105: 010
    Loc106: 010
    Loc107: 010
    Loc108: 010
    Loc109: 010
    Loc110: 011
    Loc111: 011
    Loc112: 011
    Loc113: 011
    Loc114: 012
    Loc115: 012
    Loc116: 012
    Loc117: 013
    Loc118: 013
    Loc119: 013
    Loc120: 013
    Loc121: 014
    Loc122: 014
    Loc123: 014
    Loc124: 015
    Loc125: 015
    Loc126: 015
    Loc127: 016
    Loc128: 016
    Loc129: 016
    Loc130: 017
    Loc131: 017
    Loc132: 018
    Loc133: 018
    Loc134: 018
    Loc135: 019
    Loc136: 019
    Loc137: 020
    Loc138: 020
    Loc139: 020
    Loc140: 021
    Loc141: 021
    Loc142: 022
    Loc143: 022
    Loc144: 023
    Loc145: 023
    Loc146: 024
    Loc147: 024
    Loc148: 025
    Loc149: 026
    Loc150: 026
    Loc151: 027
    Loc152: 027
    Loc153: 028
    Loc154: 029
    Lo1155: 029
    Loc156: 030
    Loc157: 031
    Loc158: 031
    Loc159: 032
    Loc160: 033
    Loc161: 033
    Loc162: 034
    Loc163: 035
    Loc164: 036
    Loc165: 036
    Loc166: 037
    Loc167: 038
    Loc168: 039
    Loc169: 040
    Loc170: 041
    Loc171: 042
    Loc172: 042
    Loc173: 043
    Loc174: 044
    Loc175: 045
    Loc176: 046
    Loc177: 047
    Loc178: 048
    Loc179: 050
    Loc180: 051
    Loc181: 052
    Loc182: 053
    Loc183: 054
    Loc184: 055
    Loc185: 057
    Loc186: 058
    Loc187: 059
    Loc188: 060
    Loc189: 062
    Loc190: 063
    Loc191: 064
    Loc192: 066
    Loc193: 067
    Loc194: 069
    Loc195: 070
    Loc196: 072
    Loc197: 074
    Loc198: 075
    Loc199: 077
    Loc200: 079
    Loc201: 080
    Loc202: 082
    Loc203: 084
    Loc204: 086
    Loc205: 088
    Loc206: 090
    Loc207: 091
    Loc208: 094
    Loc209: 096
    Loc210: 098
    Loc211: 100
    Loc212: 102
    Loc213: 104
    Loc214: 107
    Loc215: 109
    Loc216: 111
    Loc217: 114
    Loc218: 116
    Loc219: 119
    Loc220: 122
    Loc221: 124
    Loc222: 127
    Loc223: 130
    Loc224: 133
    Loc225: 136
    Loc226: 139
    Loc227: 142
    Loc228: 145
    Loc229: 148
    Loc230: 151
    Loc231: 155
    Loc232: 158
    Loc233: 161
    Loc234: 165
    Loc235: 169
    Loc236: 172
    Loc237: 176
    Loc238: 180
    Loc239: 184
    Loc240: 188
    Loc241: 192
    Loc242: 196
    Loc243: 201
    Loc244: 205
    Loc245: 210
    Loc246: 214
    Loc247: 219
    Loc248: 224
    Loc249: 229
    Loc250: 234
    Loc251: 239
    Loc252: 244
    Loc253: 250
    Loc254: 252
    Loc255: 255
    I get 252 as the 2nd to last number....with 255 being the final number (I'm guessing all 1s is a default value of unused eeprom slots?)

    therefore there must be just 255 values in that table, but if I add another value on the end (the 256th slot) ...saya number of 253...

    Code:
    data  0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, _
    1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, _
    2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4, _
    4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,8,8, _
    8,8,8,8,9,9,9,9,10,10,10,10,10,11,11,11,11,12,12,12, _
    13,13,13,13,14,14,14,15,15,15,16,16,16,17,17,18,18,18, _
    19,19,20,20,20,21,21,22,22,23,23,24,24,25,26,26,27,27,28, _
    29,29,30,31,31,32,33,33,34,35,36,36,37,38,39,40,41,42,42, _
    43,44,45,46,47,48,50,51,52,53,54,55,57,58,59,60,62,63,64, _
    66,67,69,70,72,74,75,77,79,80,82,84,86,88,90,91,94,96,98, _
    100,102,104,107,109,111,114,116,119,122,124,127,130,133,136, _
    139,142,145,148,151,155,158,161,165,169,172,176,180,184,188, _
    192,196,201,205,210,214,219,224,229,234,239,244,250,252,253
    it won't compile (compiler says stack over flow)


    So if there are only 255 values being stored in my eeprom, then why won't it let me squeeze in a byte to the final (256th byte) eeprom slot ...rather than defaulting the final value to 255?

    Any ideas?

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts