Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: Pedvide

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. You can use the PDB to trigger ADC conversions at...

    You can use the PDB to trigger ADC conversions at a fixed rate with the ADC library.
    Then you can use the DMAChannel library (it's part of the core library) to transfer the ADC readings into a...
  2. PumpkinEater, please post your complete code....

    PumpkinEater, please post your complete code. What are you connecting to the ADC pin? the DAC output?
  3. Yes and no. You need to invert the statements...

    Yes and no.
    You need to invert the statements in #2. When you call adc->setReference(ADC_REFERENCE::REF_3V3,ADC_0); it will stop the VREF, which is shared with the DAC. You can then call...
  4. Well, I guess that's something that ADC library...

    Well, I guess that's something that ADC library should allow. I think the idea of sampling several pins periodically is interesting so maybe I can try to implement it. Probably I'd implement it so...
  5. I think that should work, but you need to switch...

    I think that should work, but you need to switch on the VREF (I don't know if it's on by default) with
    VREF::start()

    VREF is included by the ADC library. You can stop it with
    VREF::stop()
  6. Yes, if you have the Audio library use the ADC0...

    Yes, if you have the Audio library use the ADC0 then you can use the ADC library to measure with the ADC1. However there's only one PDB module, so only one of the libraries can use that at a given...
  7. Your spreadsheet isn't right, have a look at...

    Your spreadsheet isn't right, have a look at mine: https://docs.google.com/spreadsheets/d/1OSILeHUIY9x1FphI3T3Iv0ci9CLovjsvGqLs5a-BUlw/edit?usp=sharing

    I've actually discovered a bug in the...
  8. Replies
    3
    Views
    838

    Continuous mode means that the ADC is measuring...

    Continuous mode means that the ADC is measuring all the time; that is, it doesn't stop when it gets a result and keeps updating it. Based in your description it's not really what you want.
    If you...
  9. Those errors indicate that the latest version on...

    Those errors indicate that the latest version on Teensyduino is not installed. I can't help you because I have no idea about that platform, sorry.
  10. Thread: Arduino or C

    by Pedvide
    Replies
    8
    Views
    1,815

    digitalWriteFast(LED_BUILTIN, HIGH); shows how...

    digitalWriteFast(LED_BUILTIN, HIGH); shows how you can have easy to use and understand zero-cost abstractions. They are zero-cost in two senses: no inefficient ASM code and no mental burden on the...
  11. VREF_SC_MODE_LV_HIGHPOWERBUF was added "recently"...

    VREF_SC_MODE_LV_HIGHPOWERBUF was added "recently" to kinetis.h (not sure when). So I guess he had a moderately old version of Teensyduino.
    The comment on RingBuffer only says that I needed to...
  12. Replies
    3
    Views
    1,712

    The standard way is using...

    The standard way is using value*3.3/adc->getMaxValue(ADC_0); where value is int value=myADC->analogRead(ADC_INTERNAL_SOURCE::TEMP_SENSOR); but as you can see there are a few options.
  13. You should probably substitute...

    You should probably substitute ADC_Module::channel2sc1aADC0 by ADC::channel2sc1aADC0. But I don't know why you want to use that example. Have you looked at the ADC library examples?
  14. Replies
    6
    Views
    1,621

    Yes, depending on the conversion rate that you...

    Yes, depending on the conversion rate that you want you should lower the sampling and the conversion speeds, especially the sampling one as your converted voltage is lower than your input voltage...
  15. The fastest the ADC can work on a Teensy 3.2 at...

    The fastest the ADC can work on a Teensy 3.2 at 96 MHz is about 1 us. If you use the T3.6 at a higher clock rate you might get a faster rate, however the accuracy of the results won't be guaranteed.
  16. Replies
    11
    Views
    10,196

    aaaxon, The ADC library is fully stable with...

    aaaxon, The ADC library is fully stable with Teensy 3.5 and 3.6. Of course there may be bugs, like in all software. Thankfully many people use it and report them.

    You're right that nobody can...
  17. Replies
    11
    Views
    10,196

    I've never used AREF, but I can tell you that, as...

    I've never used AREF, but I can tell you that, as far as I know, it's an input only pin. You need to provide enough current at your desired voltage though, I'm not sure how many mA are needed....
  18. Replies
    11
    Views
    10,196

    If you see an error in the ADC library, please...

    If you see an error in the ADC library, please post it here: https://github.com/pedvide/ADC/issues
  19. I agree with Paul, to get 12 real bits you should...

    I agree with Paul, to get 12 real bits you should probably convert at 16 bits, hardware average and a low impedance. It can be done, but it also depends on the speed that you want to get the...
  20. I'm looking into these issues, but I have a lot...

    I'm looking into these issues, but I have a lot of work. I hope I can do something on the weekend.
    Please note that Teensy 3.6 only has one differential pair!
    Also I see that you're casting the...
  21. The errors are in ADC_Module.h, but more...

    The errors are in ADC_Module.h, but more importantly is that that's a bug in the library for the Teensy 3.6!
    Please, go to https://github.com/pedvide/ADC/tree/dev and use that version of the...
  22. Arctic_Eddie, A similar image for the ADC0/1 for...

    Arctic_Eddie,
    A similar image for the ADC0/1 for Teensy 3.1/3.2 is in page 1.
  23. keraba, I can't reproduce the behavior that...

    keraba,
    I can't reproduce the behavior that you're seeing. Using your code I get expected values when I connect A2 to GND or 3.3V. Check this yourself with the latest version of the library (I don't...
  24. The correct names are updated in the github...

    The correct names are updated in the github repository!

    keraba,
    You're only changing the sampling speed, not the conversion speed. The sampling part of a measurement takes a few ADC clock cycles,...
  25. There's something strange with the link, open...

    There's something strange with the link, open doxygen/html/index.html directly, that should work.
    I'm preparing a update that will break some things, so I wanna test it before committing it to...
  26. You can't do that, unfortunately. I'm actually...

    You can't do that, unfortunately.
    I'm actually working on a "AudioInputAnalog1" object that can be used exactly the same way. However in the future having a AudioInputAnalog object that simply gets...
  27. Replies
    6
    Views
    7,488

    The maximum ADC clock speed for Teensy 3.5 is a...

    The maximum ADC clock speed for Teensy 3.5 is a bit faster than for the rest, 24 vs. 18 MHz (not for 16 bits precision, for which it's 12 MHz for all boards).
    In the ADC library, this means that the...
  28. golden2620, I suggest you use a independent...

    golden2620,

    I suggest you use a independent source for the source. You are using interrupts to generate the source and to read it; this can fail when other higher priority interrupts happen. Also...
  29. MaximeD, I'll rewrite RingBuffer and...

    MaximeD,

    I'll rewrite RingBuffer and DMARingBuffer soon. They never really worked well.
    The new design will be:
    RingBuffer: Purely software circular buffer, baed on interrupts
    DMARingBuffer:...
  30. Replies
    17
    Views
    3,476

    If your values are less than 1.2V high then maybe...

    If your values are less than 1.2V high then maybe you could use the internal reference, that should be more isolated.
    Or even an external reference that is isolated from the USB power somehow.
  31. The ADC library has support for PGA. But PGA only...

    The ADC library has support for PGA. But PGA only works for the differential pins A10-A11, A12-A13 (and only for Teensy 3.1/3.2).
  32. Well in any case you should start with an easier...

    Well in any case you should start with an easier sketch like Blink.
    F_CPU is passed to the compiler as a flag (see how arduino does it), F_BUS is then derived from F_CPU (usually it's half)
  33. Replies
    3
    Views
    1,320

    The fastest conversion Teensy 3.2 can do is about...

    The fastest conversion Teensy 3.2 can do is about 0.8-1.0 us, so it's doable. Synchronizing the conversions to a given external signal may be difficult, though.
  34. Replies
    26
    Views
    5,584

    SaileNav, If it works now, then no! I though...

    SaileNav,
    If it works now, then no!
    I though you were using the internal 1.2V reference, that's why I suggested the ADC_REF_1V2 option, if you want to use the usual 3.3V then either do nothing (as...
  35. Replies
    26
    Views
    5,584

    I'm testing it, but I really really don't...

    I'm testing it, but I really really don't understand what your code is doing.
    I've tried to get rid of the python stuff and print the mean value of a pin in the serial port, but I don't even...
  36. Replies
    26
    Views
    5,584

    I'll try to test it today, now that we know it's...

    I'll try to test it today, now that we know it's not a hardware problem.
  37. Replies
    26
    Views
    5,584

    Yes, that's the one that gives directly the sc1a...

    Yes, that's the one that gives directly the sc1a value, as you see ADC::channel2sc1aADC1[A16]=ADC::channel2sc1aADC1[27]=5, but some space is wasted with 31's that Paul manages to save.
  38. Replies
    26
    Views
    5,584

    You're mixing things! That code belongs to the...

    You're mixing things!
    That code belongs to the core analog.c, while the ADC library uses a different one!
    The analogRead function in analog.c in subtracts from the pin number to "compress" them...
  39. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    Ok, great! Thanks a lot manitou and KurtE!...

    Ok, great!
    Thanks a lot manitou and KurtE!
    There are a few (internal) details still unfinished, but that's all I needed!
  40. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    Ok, I think I found the bug. If you can test it...

    Ok, I think I found the bug. If you can test it again as before it should work now.
  41. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    Well the differential value is correct, and so is...

    Well the differential value is correct, and so is A10, but A11 isn't right so i'll fix it and let you now so you can test it again.
    Thank a lot manitou!
  42. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    manitou, Set pin A10 to 3.3V and A11 to GND....

    manitou,

    Set pin A10 to 3.3V and A11 to GND. Check the value of
    Differential pairs: 0: x.xx
    it should be 3.3. Then switch A10 to GND and A11 to 3.3V and see if it becomes -3.3.
    The values of...
  43. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    I've updated the ADC library to support Teensy...

    I've updated the ADC library to support Teensy 3.4/3.5.
    I've tested it on the Teensy 3.5 PROTO5 I have, however I have no access to the A10-A11 pins, could some of you with the PROTO6 board test...
  44. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    Murphy's law always applies! haha I think it's...

    Murphy's law always applies! haha
    I think it's ok, I can test the differential code on A12-A13, and when everything is ready I'll update the library and ask somebody with a PROTO6 to test A10-A11....
  45. Replies
    7
    Views
    1,670

    The ADC library has an example of precisely that....

    The ADC library has an example of precisely that. I agree that it's the only way to have low frequency measurements.
  46. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    Mine is PROTO5, that explains it! I though I had...

    Mine is PROTO5, that explains it! I though I had gone crazy...
  47. Thread: K66 Beta Test

    by Pedvide
    Replies
    1,558
    Views
    512,307

    Thanks for the board! I'm testing the ADC...

    Thanks for the board!
    I'm testing the ADC library and is going well, but I can't find A10-A11!
    I'm using Paul's code in #333, so simply displaying the value of each pin.
    In my board the numbers...
  48. Replies
    26
    Views
    5,584

    Well, I'm at my wit's end! If you post (or send...

    Well, I'm at my wit's end!
    If you post (or send me privately) the full source code I can test it today or tomorrow.
  49. Replies
    26
    Views
    5,584

    Another thing: Have dma2_isr blink a led to make...

    Another thing: Have dma2_isr blink a led to make sure it executes, do the same for adc0_isr and adc1_isr.
  50. Replies
    26
    Views
    5,584

    Yes, you're right! I was looking at the ADC0...

    Yes, you're right! I was looking at the ADC0 numbers by mistake.
    Now I see that in adc_setup you use adc->adc1->setReference(INTERNAL);
    What's INTERNAL? You should be using ADC_REF_3V3,...
Results 1 to 50 of 273
Page 1 of 6 1 2 3 4