Search Results - MEL PICBASIC Forum


Search:

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

Page 1 of 4 1 2 3 4

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    12,375

    Re: PBP3 Code Does not Compile with PBP3.1

    All my code projects compiles just fine with .bas INCLUDEs. So far.
  2. Replies
    5
    Views
    12,375

    Re: PBP3 Code Does not Compile with PBP3.1

    That's it! Thank you so much Richard. I've got both lines in my code but with comments as to which to use with which compiler.
  3. Replies
    5
    Views
    12,375

    PBP3 Code Does not Compile with PBP3.1

    I upgraded to PBP 3.1 recently and while some PIC code compiles just fine the following does not (although it compiles with PBP3 - I just switched my compiler to the old folder and it worked):


    ...
  4. Replies
    2
    Views
    28,801

    Re: ADC and Interrupt on Change

    Thanks richard - that's what I suspected. The reason I wanted to move the ADC check to an IOC_INT was I had code in the Main loop to pulsate a LED which had PAUSEs in it which meant that you could...
  5. Replies
    2
    Views
    28,801

    ADC and Interrupt on Change

    I currently have a project which checks for changes on a trim pot as part of the main loop (the trim pot/ADC value then controls the brightness of a LED). It samples 16 readings and then sorts them...
  6. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    In case anyone is interested in the final working code (using linearization correction):



    ' For production version of this code, comment out the line below re:
    ' LCD debugging and also update...
  7. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Ugh. Of course. Now it works perfectly, with a final PWM duty cycle of 511.
  8. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    I expect something to show on the LCD, but it stays blank.

    EDIT: I moved the LCD instructions to the loop to see what I could see and the final PWDuty value is 12291, way more than 512. The LED...
  9. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Tried this but it doesn't fade in the LED and I never get anything on the LCD screen after the counter to 100:



    ' For production version of this code, comment out the line below re:
    ' LCD...
  10. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Everything works just fine now. The last thing I need to do is introduce linearization correction to get a better, more linear fade in. I think the info in this thread should help.

    Question: if...
  11. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Thanks Dave and tumbleweed! I've never had to use DIV32 before so I appreciate the explicit examples.
  12. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    I grabbed this scaling function from an Arduino library and was emulating that:



    ' Arduino Map function to emulate:
    ' ===============================
    ' map(value, fromLow, fromHigh,...
  13. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Thanks again tumbleweed. I can't use PBPL without moving up to a 18F chip, and the minimum # of pins is then 18 (I only need two outputs so an 8-pin chip is ideal. Also, the PCB is pretty cramped now...
  14. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    That explains it, thanks very much. When I do the math by hand the 255's cancel each other out and then it's just 412+100.

    If I put brackets around the dividing part will that fix it?
  15. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Reset DataW to WORD variable (as it should have been all along) as well as the two ADC variables (since it's left-justified or 8-bit) but am still only getting a max value of 254 from the...
  16. Replies
    21
    Views
    12,119

    Re: Weird ADC / Math Results with 9-Bit PWM

    Thanks tumbleweed. I think I had that as a WORD earlier, but I will try it again today.
  17. Replies
    21
    Views
    12,119

    Weird ADC / Math Results with 9-Bit PWM

    I'm trying to use 8-bit ADC to control the brightness of a LED via PWM. The goal is to have a smooth fade in to the brightness set by the trim pot so I eventually want to introduce linearization...
  18. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    Could the 0.1uF cap across Vdd/GND have an effect here? I just swapped out the one on the breadboard for another and now the readings seem stable.
  19. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    At 8-bit ADC it works much better; very little (if any) variation. Since I only need to adjust the brightness between 75-100% maybe 8-bit will be OK.
  20. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    Switched to using a 16F1825 that was previously rock solid and it's still jumping around like crazy. Could it be this 5V switching voltage regulator? This code was what I used previously to test...
  21. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    The 5V voltage regulator is a linear switching one from Pololu and the voltmeter output looks rock solid. It could be the pot, though - it's a sliding one from Sparkfun. i'll try with a traditional...
  22. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    I removed the CCP stuff to leave just the ADC and still the value jumps around by +- 6 or more:



    DEFINE OSC 16 ' Set oscillator 16Mhz

    ' For production version of this code,...
  23. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    There's a PAUSEUS 50 there - isn't that sufficient?
  24. Replies
    44
    Views
    27,451

    Re: Scaling ADC Result to a Set Range

    Well, they were rock solid. Now the readings are varying quite a lot and even with Melanie's 'averaging' code to pick the middle 8 values from 16 it's still jumping around a lot (and still doesn't...
  25. Re: PWM of voltage input to PIC - will it damage the chip?

    It's a 12F683. This forum won't let you edit a post after some time has passed so I couldn't update it.

    Maybe what I could do is have 3 wires go up to the board - +5V, GND & +5V* (PWM control just...
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4