Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: HankMcSpank; Keyword(s):

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    You are welcome ;-)
  2. Replies
    36
    Views
    25,017

    Re: Linearizing an LED for 800 pwm steps'?

    Hi, that worked a treat, here's the output after modifying with your snippets...



    Gamma array size: 255
    Total PWM steps: 1023
    Gamma correction: 2

    DW 0, 0, 0, 0, 0, 0, 0, 1, 1, ...
  3. Replies
    36
    Views
    25,017

    Re: Linearizing an LED for 800 pwm steps'?

    Hiya,

    Long time no code!

    I'm wanting to use Mike, K8LH 'Just Basic' code to generate values towards linerarizing an LED for PWM ...what Mike has done is great & & more or less ideal for my...
  4. Replies
    36
    Views
    25,017

    Re: Linearizing an LED for 800 pwm steps'?

    Keep coming back to this. (I I like a breather in between!)

    Is there any electronic sensor that mimics the eye's 'response' curve out there that I can buy & put a scope on its output? What I'm...
  5. Re: How can I achieve this? (hand drawing a curve then mapping values to 1024 LUT

    Thanks guys (& sorry for the delay in coming back here)



    But current doesn't flow without voltage, so in a roundabout way by controlling the mean voltage you are controlling the current.
    ...
  6. How can I achieve this? (hand drawing a curve then mapping values to 1024 LUT

    Hi All,

    I'm trying to linearize LEDs for use with 1024 PWM (lots of different types of LEDs), but I'm finding it really troublesome ...I'm using a lookup table & using a 'hit & hope' method...
  7. Re: Trying to determine dc current - 12v lead acid battery charger

    It doesn't matter whether the resistor is 'in line' with the 12V supply wire ....or inline with return to ground wire....the same current will be present (the current leaves the charger, goes through...
  8. Re: Trying to determine dc current - 12v lead acid battery charger

    It is kind of correct..... 10mA through a 0.47R resistor = 0.0047V drop across it (which, if you look back above the above posts, with a 5V ADC reference & 1024 bits, you can resolve 0.0048828125V...
  9. Re: Trying to determine dc current - 12v lead acid battery charger

    It's pretty simple...let me try & explain.

    If your PIC is running at 5V, then you're ADC resolution becomes 5V/1024 (the 1024 being 10 bits)...this results in a resolution of 0.0048828125V...
  10. Re: Trying to determine dc current - 12v lead acid battery charger

    Whilst that higher resistor will give you 4x the ADC reading vs a 0.1R resistor, that's still only an ADC variance of about 60 steps between 1000mA & 300mA for a PIC supply of 5V....like I say, if...
  11. Re: Trying to determine dc current - 12v lead acid battery charger

    300ma x 0.1R = 30mV

    1000ma x 0.1R = 100mV

    Your PIC is on a 5V regulator, so assuming 10 bit ADC = 5V/1024 = 0.0048828125V per ADC 'bit'.

    30mV divided 0.0048828125V = ADC reading of 6 for...
  12. Re: Trying to determine dc current - 12v lead acid battery charger

    Which isn't a whole lot of resolution.

    I'm not sure which PIC you're using, but I use the latest range of PIC16f182x ....certainly with that suite of PICs (& mybe others...dunno), you can tie the...
  13. Replies
    5
    Views
    3,688

    Re: DT interrupt problem

    I'm no expert, but you've created a
    CCP1_INT interrupt, then done this...






    @ INT_ENABLE INT_INT ; enable external (INT) interrupts
  14. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Ok, it looks like interrupts are a big no-no here so I've established a way of doing this without an interrupt...



    T1GCON.4 = 1
    Loop1:
    pause 500
    T1GCON.3 = 1
    TMR1=0
    while T1GCON.3 = 1
  15. Replies
    3
    Views
    3,200

    Re: While loop on pwm module

    Also if you're increasing the PWM duty cycle & expecting the ADC'ed voltage to rise until a target is met, then I think you'd want it arranged like this...

    while feedback<153 (in other words,...
  16. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Firstly, I spoke to soon. Whilst this latest method mentioned in my last post has allowed me to detect higher frequencies....I'm still getting erratic results in & around the 450-700Hz audio...
  17. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Thanks guys...I'm now approaching this in a slightly different way & getting reasonable results (I think!)

    I'm using timer1 gate & comparator2

    Here's the sequence....

    Comparator2 goes...
  18. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Just thinking out loud here...if all the overhead comes from entering & exiting the interrupt routine ...if I dedicate my main loop solely to measuring high/low transitions on a pin (ie feed the PICs...
  19. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Just as an experiment, I would like to see how high in audio frequency I can go with something like the ASM interrupt method discussed in this thread...
    ...
  20. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Hi Bert,

    I re-enabled hserout out in the ISR again, and these are the TMR1 counts I'm getting for successive comparator2 interrupts with an audio input of 82.4Hz (the lowest note/frequency on a...
  21. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Thanks for the input Bert, I changed the interrupt to ASM...


    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler CMP2_INT, _CMP2_Interrupt, ASM, YES
    ...
  22. Replies
    22
    Views
    12,541

    Re: Frequency detection (audio)

    Ok, so I took the HSEROUT command out of the ISR ...... & then my ISR 'toggle pin' frequency scoped correct up to around 900hz audio input ....however, above that 900Hz audio input, even with just a...
  23. Replies
    22
    Views
    12,541

    Re: Frequency detection (audo)

    No...I hadn't so put a toggle in my ISR (top tip - tks!)

    I've scoped the ISR 'toggled' pin & I'm seeing 250hz on there?!! (therefore 2 x 250hz = an interrupt rate of 500Hz ....this for a 1kHz...
  24. Replies
    22
    Views
    12,541

    Re: Frequency detection (audo)

    I don't think that's the issue, here's a scope screenshot of what the PIC's internal comparator is seeing internally...


    http://www.hostmyjpg.com/images/4c8331896e_comp.jpg


    The white...
  25. Replies
    22
    Views
    12,541

    Re: Frequency detection (audo)

    Good spot!

    Here's approx the Timer counts I'm seeing for different frequencies...

    82.4Hz (lowest note on a guitar) - 42,900 (ish)
    330Hz (top E) - 7,300(ish)
    600Hz - 1800 (ish)

    650Hz...
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4