Xerrorable
Member
Hi,
I realize that this question might have been asked multiple times in some other shape or form on this forum. I have read several of these threads, but I just can't figure out what is best. I would really appreciate the help!
My question regards the optimization of serial communication between a Teensy 3.6 and my Python (3) program. The Teensy is used as a data acquisition tool and the Python script is used to control the Teensy and visualize/store measured data.
My project is a sort of home-made scalar network analyzer, which outputs a voltage value for the Teensy ADC (at 13 bit resolution) to be read.
Each measurement consists of a frequency sweep from a certain starting frequency to a final frequency at a certain step size. (e.g. 15,000,000 Hz to 15,100,000 Hz with steps of 1 Hz) I need to record the ADC value (analogRead()) at each frequency and somehow communicate this to my Python script on my PC. As you can imagine this is quite a lot of data that has to be transferred and I wonder how I can transfer this in the most efficient way.
I have already noticed that allowing the Teensy to just Serial.print() the values will quickly overflow the buffer. Implementing a delay is possible of course, but I really need the data transfer to be as fast as possible.
Is there any other way to allow for faster communication without large delays or was my choice of Python just poor?
I am very much looking forward to any advice! Just general advice regarding the feasibility would already be very welcome. I could of course share my code, but at this point we would probably get lost in the details as I am a beginner programmer.
Cheers.
I realize that this question might have been asked multiple times in some other shape or form on this forum. I have read several of these threads, but I just can't figure out what is best. I would really appreciate the help!
My question regards the optimization of serial communication between a Teensy 3.6 and my Python (3) program. The Teensy is used as a data acquisition tool and the Python script is used to control the Teensy and visualize/store measured data.
My project is a sort of home-made scalar network analyzer, which outputs a voltage value for the Teensy ADC (at 13 bit resolution) to be read.
Each measurement consists of a frequency sweep from a certain starting frequency to a final frequency at a certain step size. (e.g. 15,000,000 Hz to 15,100,000 Hz with steps of 1 Hz) I need to record the ADC value (analogRead()) at each frequency and somehow communicate this to my Python script on my PC. As you can imagine this is quite a lot of data that has to be transferred and I wonder how I can transfer this in the most efficient way.
I have already noticed that allowing the Teensy to just Serial.print() the values will quickly overflow the buffer. Implementing a delay is possible of course, but I really need the data transfer to be as fast as possible.
Is there any other way to allow for faster communication without large delays or was my choice of Python just poor?
I am very much looking forward to any advice! Just general advice regarding the feasibility would already be very welcome. I could of course share my code, but at this point we would probably get lost in the details as I am a beginner programmer.
Cheers.