@mjs513 - I just updated both sketches ;)
Now have some of the DMA stuff in a class as part of the sketch, where I then created two instances of it, Where I setup two dma operations, one on ADC1 and other on ADC2... ...
Quick update:
I updated the above sketch not to use the DestinationCircular and interrupt on half way to instead be a setup of two different buffers, each pointed to by a dmaSetting object and then one dmaChannel...
@mjs513...
Yep coming along.
I am doing a little playing with DMA. So far not updating any of the ADCL class. But here is the start of an example that is continuously doing DMA read operations, and I have it...
@mjs513 - Hopefully next up figure out what we should do with the DMA cod with ADC..
Currently there is code in ADC library called class RingBufferDMA which I am sure started from his RingBuffer code, which you could...
Ok I edited it like you mentioned...
You might want to take a look, to make sure I did not screw up something.
https://github.com/PaulStoffregen/cores/pull/406
Will do.
I for sure would not delete the old defines. Have two choices, both ways are in imxrt.h.
That is could redefine all them as reflecting the new structure: like with I2C...
} IMXRT_LPI2C_t;...
@Paul was wondering about possible additions to IMXRT.h. That I have run into as part of the ADC port to T4 Things like:
ADC structure definition:
Which I currently have in the ADCL_t4 library:...
@PaulStoffregen... :D Sounds great.
There were a few other PR's out in special thread, like fixing some issues for Wire. @mjs513 has a nice version of the ST7735_t3 code base...
Wondering about things like ADC...
Again others can answer better than I can...
I do very little Analog stuff, and rarely do I need to write stuff to SDCards...
Usually just enough to help other fix problems or testing out new Teensy boards...
...
@mjs513...
I hacked up my test program on T3.5 to generate the sine wave where I use one pot to change the amplitude...
Again not the cleanest setup, but:
#include <Audio.h>
#define POT_PIN 14
int last_pot_val...
You can use the ADC library on T3.x (and LC), and use DMA operations to collect.
As how fast you can write out to SD Cards... There are several threads and other places on web to find information. For example look...
Assuming you are using the Teensy version of the Wire library.
Wire.h and Wire.cpp I believe are only used for AVR boards like Teensy 2.
WireKinetis.h/.cpp - Are used for Teeny 3.x and LC
WireIMXRT.h/.cpp - are...
@defragster - Will have to remember that later. Luckily not building too much with it here...
@mjs513 - Pushed up a few more changes/fixes - Playing with the continuous update example. Having issues with enable...
I know there are probably easier ways and maybe I will play around some more with it, but as for test sketch, can always use Audio library. Example one I just setup to run on T3.5 (or 6)...
#include <Audio.h>
//...
Simple question is why not just uses the values in kinetis.h ...
But Lets look at S1...
#define UART2_S1 (KINETISK_UART2.S1) // UART Status Register 1
It is based off of the address of UART2:
#define...
@mjs513 - fixed (I hope) the problems I mentioned in the last message, like adc->analogRead(pin);
Will now check to see if valid pin on any ADC if so it will use the first valid one (i.e. if in my table does not have...
@mjs513 - Hopefully I did not screw up everything, but I merged in the DMA branch...
Still not totally functional yet, but it also has a lot changes for housecleaning.
That is I moved most of the functionality out...
@mjs513 - I will merge in some of my stuff soon, to master. It has some of the stuff for adc->adc0 (or 1) but so far I have not added in all of the error stuff.
Made some progress on the DMA stuff, The DMA ISR...
@mjs513 - Hope you are doing well.
As for new branch/master/DMA.. hard to say, I started new branch as there are at least the two of us, and did not want to break everything yet.
I am trying to decide for...
@mjs513 - I see that you added some stuff...
Note: I just pushed up a new branch DMA_SUPPORT -
Where I am trying get some of the examples to be able to build and then hopefully work like the ringBufferDMA test...
@mjs513 - Still totally distracted :D Hopefully later today I will maybe have the opportunity to concentrate a little.
I probably should start off hacking something up, but I find myself wanting to generalize...
Again hard to say what all you need or don't need. Or what your plans are.
I personally just use the Arduino setup, which is fine for the things I wish to do.
Understanding the board. I assume you found the...
@mjs513 - will take a look..
Here is a sublimetext mucked with table for XBar1...
Wonder this would be valid/reasonable addition for imxrt.h? And if so do I need to do XBAR2...
// XBAR1 Inputs and Outputs...
@mjs513, @PaulStoffregen @manitou, ...
Thought I would see how hard it is to do ADC using DMA at some specific sampling rate, Example for trying to guess if an power is running to a well pump, so with T3.6 I setup...
Hi @mjs513 - Yep more coffee (Feel free to PR it)! You probably know more about all of this than I do!
@jonr - DMA does not look too hard to add here... Again @manitou has example app, which I will try out soon
@mjs513 @manitou... Yep I did clone that project down to my disk as well and I am curious about how one sets up to do DMA from the ADC at a specific input rate.
That is with my always never completed well monitor...
@mjs513 - Me too, but when I did not find it in RM, decided to look.
Just pushed up a quick and dirty ReadMe.md file which is a copy of pedvide's Readme with a warning at top that this is a WIP and who knows what...
Others can maybe give you more exact answers to this...
But void* just means it is a pointer to something... So often times with functions like this, I will then cast it to something like uint8_t* to process.
...
@mjs513...
I have been playing around with a semi stripped down version of ADC, which for now I put up on github... I am not sure if it will stay or not...
But if you want a laugh...
...
@someteen (@PaulSoffregen) -
As has been mentioned several times before, I have absolutely no idea how they or who might try to encode the 9 logical bits of data if it is begin sent back and forth over USB...
...
I believe the AVRC5S is simply another level of protection. For EMI and ESD... I have not used them yet on my own boards... http://www.1688eric.com/upload/pdf/2012-9-11/AVRC5S05Q050100R.pdf
My guess if the circuit...
Hi and welcome @Fikri - Might help to know which Teensy... For now I will assume T3.x, TLC, or T4... (ie. not T2), and also which servos. i.e. some libraries only support Protocol 1, so if your servos use protocol...
I just updated my Early 2013(or 14) MacBook Pro to Catalina.
Then downloaded your package. I tried running, and it did not want to run... So Ctrl+click and run and then it appeared to work fine after. I...
@mjs513 - Thanks, I thought I remembered seeing something during beta..
Wondering with our hacking if we should repackage the test stuff to be more like: ADC Light?
That is to convert the stuff into an object...
@mjs513 Good Morning,
Good question? Especially if the goal might be to get this functionality into core?
Or should we aim to be semi-aligned with the ADC library? The only place that I have played much with...
Since it does the same thing on an Arduino Uno, if you have not already done so, you might try asking about this up on the Adafruit forum...
You might also mention things like, what version of Arduino you are using...
Have you looked at the keypad library?
Not sure which is best example, but examples->keypad->EventKeypad is one...
WHich takes care of rows and columns...
More information up on google searches, like:...
Not sure what you have tried or looked at?
Have you looked at the PJRC pages like:
https://www.pjrc.com/teensy/td_joystick.html
as part of this, have you looked at the example sketches like:...
@mjs513 - Yep I just copied the 8 bit setup to a special 8 bit setup..
As I noticed that already the 8 bit mode did not turn on the ADLSMP bit, like 10 and 12 do...
void T4AnalogReadRes(unsigned int bits, uint8_t...
@jonr - we have a T4 that is small and inexpensive. But Paul asked what pins we might want in a T3.6 form factor as per post #1
Edit: I meant to mention, that I am not in full disagreement, just that thread is...
@mjs513 I hacked up my version of code to add in a mode to set the resolution to 0x88 and if so it is 8 fast...
Quick and dirty T4 Analog Read stuff
8:2(000007a3 00000000)> 3 127 6 : 10 127 7 : 1 126 3 : 1 127 4...
@mjs513 - Quick update: If you look at my previous post, with the updated test sketch that sets both the resolution and averaging.
And you look at the output line: 8:2(000007a3 00000000)> 0 127 7 : 10 127 6 : 1 127...
@mjs513 - Will probably leave init and the wait for calibrating alone (if it aint broken... )
In Your previous post, this line just feels wrong:
mode = ADC_CFG_MODE(1) | ADC_CFG_ADSTS(0) | ~ADC_CFG_ADLSMP |...
@Paul - any updates?
Some things I am very curious about, is how compatible will the T4.? be with the T3.6 layout?
Example can I drop in one of these instead of a T4 and use the USB host pins? That is will the...
My guess is that it by default in high powered mode, as I don't see anywhere in the code base that sets: DAC_C0_LPEN
You did not give any reference on how you are using it? Are you using external library....
But...
@meo - Maybe on buffer1 but for sure in your original program, the global variable i. That is your code has(d):
void setFlagandReadBuf() {
i = 0; //to be repeated that we measured for...
@mjs513 - I think it, is either a hold over from T3.x analog code or, we ran into some issue, added code to init and...
That is I think we can either get rid of the line: if (calibrating) wait_for_cal();
AND the...
@mjs513 - Yep, my problem is, when is calibrating ever not 0?
The only places I see it ever set, is in the init function:
...
//ADC1
ADC1_CFG = mode | ADC_HC_AIEN | ADC_CFG_ADHSC;
ADC1_GC = avg |...
@mjs513, @PaulStoffregen - I updated my changes that I pushed to include the above.
Good catch on the init function looking at the wrong one.
I did update the wait_for_cal, sort of like you mentioned, except, I...
@mjs513 I went ahead and hacked in the function I mentioned...
Also put in loop calls to set the averaging... Although I just used the default one so far..
usbHost - Something new and shiny to play with?
My quick look through the functions, analogResolution and analogReadAveraging, I thought they were both already handling both ADC1 and ADC2
Example analogReadRes:
void analogReadRes(unsigned int bits)
{
uint32_t...
@tasha @mjs513 - I hacked up a version of AnalogRead that allowed me to choose a channel 1 or 2 to do conversion.
Also did a version where I broke it into two parts. First starts conversion, second checks or waits...
Works for me...
I modified your code slightly as to remove the overhead of calling main:
#define MCLK 9
byte pulse = 0;
void setup() {
pinMode(MCLK, OUTPUT);
}
Still playing with it...
With my own board, which I hopefully fixed some of the issues I was having running the Servos. Like wrong resistors, maybe cold solder...
And what may be a bad AX servo, I plugged in an...
@tsaha - As I have mentioned I do most things in digital, so others maybe can help more.
It would be great if the library ADC was ported over to the T4. But it looks like the owner (pedvide) of it, has not been up...
@wwatson - Wondering how much different is this than the RA8875 boards? i.e. wondering if it makes sense to add support for this board into the RA8875 library code that we forked from Sumotoy?
As you mentioned...
@Paul - great to see the USB stuff being updated! Trying to decide if there are enough people beating up on this and wait...
For now I may simple install fresh copy of Arduino 1.8.10 into new directory and do an...
Thanks @KG5NII - understand.
Compatibility is an interesting thing.
Yes - we did play around with the buttons, as to make them to be compatible with the more current Adafruit GFX code, which originally the...
Quick update, I am running your sketch, and I am seeing CR and LF...
That is: Some output:
this loop(): 11 µs
dmaRXisr: dest=0x20000D3C
prev loop(): 67391 µs...
I will try to take a quick look.
I did pull out an Adafruit Ultimate GPS unit out of my displays and sensors box...
I wired it up to T4 to Serial2. Did a quick and dirty sketch:
void setup()
{
while(!Serial...
I know there have been a few different conversations about this in different threads, but as I testing out some stuff on T4 again, and ran into the issues, I thought I would mention it again, and see how much if any...
Good luck.
When you mention switching to different library and causing more trouble than it is worth... Would be interesting to know what the issue may be.
That is in theory the code base should be compatible...
Works for me...
However make you are editing the version of the library being used...
That is when I edited it, I changed it in my <documents>/Arduino/libraries/wire directory as I have a private version (github...
Quick update: I thought I would try some of it out with the recent T4 board I assembled...
Found out I screwed up on the board and when I did a copy and paste of a couple of resistors, I forget to edit the values so...
As I mentioned ILI9341_t3 does not support Opaque text drawing when you set a font, such as: tft.setFont(Arial_24_Bold);
However as I mentioned: ili9341_t3n does...
https://github.com/KurtE/ILI9341_t3n
Which...
@PaulStoffregen - That will be great!
@Gadget999 - In the mean time, you might be able to play around to see if you can avoid the issue...
And again I don't know if it would work for you or not. At different...
As for the Circuit - I have not used that form of circuit with a teensy.
I either use the built-in teensy half duplex support or I use a driver chip(or chips)... Both are supported by my older bioloidSerial...
Yep - as @neurofun mentioned you have the option to either output transparent or opaque depending on if you set the background color or not...
Also as you have not shown complete code, we can only guess that you are...
@defragster - wonder if I need to learn more about how VS... works and try to build a version that is totally stand alone and does not require run time support?
Hi @xoxu - I am not sure if there is any easy answer to your set of questions. But I will do my $.02 worth of stuff.
I have used several boards over the years to control typically up to about 20 servos. 3 DOF...
For what it is worth, this built and run on T4...
PROGMEM const char buffer = {0};
void setup()
{
while(!Serial && millis() < 5000);
uint32_t sum = 0;
for (uint32_t buffer_index = 0; buffer_index <...
Some of the others might be able to give better answer, but having a voice.end() makes sense.
Until then you can probably get the pin back by doing something like:
pinMode(A14, INPUT);
I have not looked...
Screen update speed - Is more likely to be bounded by SPI speed than the processor speed. So probably no real difference. RA8875 Speed - a lot depends on what you are needing it to do. If you do several primitives...
What I wonder from your posting #8, why it does not support Teensy?
Could it be that it does not like the other HID protocol defined for the Serial emulation?
I don't remember how hard it is to try to configure...
I could be wrong, but I believe that when the teensy is setup to emulate a keyboard it is setup to be boot protocol...
That is:
#ifdef KEYBOARD_INTERFACE
// interface descriptor, USB spec 9.6.5, page...
I don't see anywhere where you are enabling the interrupt? That is the IMR register and probably maybe need to setup ICR1 and/or ICR2 depending on which pin...
Also when I mention not putting code into constructor, but instead into setup (sort of paraphrased), I am not implying you need to as @luni mentioned (which is fine),
but instead maybe reorganize the code...
Again take this with a grain of salt...
But you might show a picture of your setup, to make sure there is nothing obvious going on.
Examples: like the T3.6 plugged into breadboard but the pins were not soldered...
Warning: I am mostly a digital guy... But wondering how you have all of it hooked up?
That is is your setup to look at the analog value setup to use the Analog Ground? Or is your sample device (battery) setup to go...