Thanks for clarifying this
Based on your description, my best advice to you would be to start with the standard "transmitEnable (pin)" function.
The reason I went with Hw Managed TX Enable was...
Type: Posts; User: pramilo
Thanks for clarifying this
Based on your description, my best advice to you would be to start with the standard "transmitEnable (pin)" function.
The reason I went with Hw Managed TX Enable was...
I think what Kurt was trying to establish/understand is your setup.
If we know your setup better we can provide more useful (and appropriate) advice
So for part 1, if you could tell us what...
Hi Kurt
That makes sense. Wasn't aware of that and thank you for clarifying it!
Hi
Just a quick update on the instructions above:
The instructions UARTx_MODEM |= should always be placed AFTER the Serialx.begin().
If you place them before Serialx.begin, Teensy appears...
Hi
Upon looking over the Serialx.c code due to a recent issue (posted on this forum), I noticed that at Serial_being, we have RX pin set up as:
PORT_PCR_PE | PORT_PCR_PS | PORT_PCR_PFE |...
@Kurt, I'm getting off topic here, but I'll be brief:
From my experience, the loss of ID occurs when you have a brownout (even though ATMEL, the processor in AX-12, claim they have brownout...
@KurtE As a side note, my usage is in Dynamixel compatible devices as well.
We had never seen this before because we mostly build our communications packet into an array and then use...
17570
I'm not sure if the above case can be resolved.
In the image:
Channel 0=Output of TX on teensy
Channel 1=Output of the buffer (trucanted)
Channel 2=TX Enable from the teensyduino...
Glad to know it's resolved.
I made a post on the forum explaining how to get the TxEnable pin to be managed by hardware (by the processor).
This seems to have resolved a LOT of the problems.
...
Hi,
Teensyduino supports the transmitterEnable(pin) on all UARTs for use in applications where you need to signal that Transmission is ongoing. A typical case are RS485 chips but also applies to...
Hi Kurt,
Using the global variable is the approach I took.
It's mostly as you wrote it, plus some corner cases that need dealing with.
The main issue though is in the ISR. In your code, when...
Hi Kurt
There is an upside to calling transmit_Assert early on, which is to give the chip enough time to switch to transmission mode.
Modern chips are almost instant but still...
I will give...
Interim update:
There seem to be 2 separate issues, which I coincidentally documented above. (my post #16...
NEXT TEST RESULTS:
Test consisted in the same approach as before, but now we add the TxEnable pin via Hardware, by means on the TXRTSE flag.
I added the following code after Serial2.begin(..),...
Kurt, thanks for the proposed solutions.
I am taking a step by step incremental approach to go through everything I tried and everything you suggested.
I have now been able to confirm that TX...
Hi Kurt,
What I found so far is that the problem does not seem to be solved by simply hacking serial_putchar or serial_write.
What I've tried to far was far more comprehensive, because I...
Tomorrow I will be conducting tests using both the software TransmitEnable and the hardware implemented TransmitEnable that I mentioned, and compare results using a Logic Analyser
I will also...
Hi Kurt
I tried those changes and I also tried some other, more aggressive ways to make the operation atomic.
None of them resolved the issue.
Hence my post from earlier today.
...
Hi
I'm not sure if you ever got around to resolving this.
I myself also encountered problems with the timing of the TX Enable pin. There's a long thread here...
Quick update: Haven't had much luck getting this to work.
It appears someone else has reported similar issues before https://forum.pjrc.com/threads/56281-Troubles-with-RS485-between-2-teensy
...
Hi
I never really got back to this thread as I was under a significant time constraint during my original posts. I apologize for nor having been able to test the code as requested.
In this...
Hi Kurt,
Good point spotting the place in Red. Hadn't nailed that one down.
I've been RTFM'ing quite a bit about this; not only the Teensy processor datasheet but especially alternative...
Your take on lines #10-24 makes sense. Thank you for clarifying. I'm not enterily familiar with the NVIC in Arm. (I come from Atmel)
I'm still at a loss regarding the TxEnable pin. The bugfixes I...
Here is sample code that will provoke the malfunction described, on a Teensy 3.2:
1. #define USB_SERIAL (&Serial)
2. #define RS485_SERIAL (&Serial1)
3. #define TTL_SERIAL (&Serial2)
4.
5....
Upon thinking about this for a while, this is definetely a potential race condition between the TCIE interrupt firing and de-asserting TXEnable while we add a new character to be transmitted:
Here...
Hi,
We are using a Dual Tristate buffer to pull the Teensy Serial Output to 5V and to simultaneously create a one Wire communication line (Nexperie 74HC2G125).
This relies on the Tx Enable pin,...
Hi all,
I have now built the code and have been benchmark'ing it:
--> I left all the constants and the whole Teensy library in its original form. I use send_now() when I wish to send...
Hi Kurt,
Thanks for all the advice.
Can you clarify 2 points for me:
What I've seen, from further experiments is that if you call send_now() (or flush()) and host happens to start...
The source code for the Benchmark is attached.
FYI: It's written in C#. I tested compiling with VS2015; in theory it should also compile with Mono under Linux but I haven't gotten around to testing...
I did try to use that with a timer. Code below:
#define USB_FLUSH_TIMEOUT_MICROS 500 // tested with 1000 as well
uint32_t last_usb_flush;
void setup()
{
Serial.begin(10000);...
Hi all
Once again than you all for your advice.
I have built a benchmark suite and have actual values and findings to share.
The setup: as I explained earlier, this is a master-slave setup,...
Thank you all for the advice.
I will try to gather data in a presentable way and hopefully post back with some performance measurements using the Teensy LC, for future reference.
Thanks for pointing that out.
I've looked at the actual implementation of Serial.flush() - function usb_serial_flush_output(void) in file usb_serial.c and it seems to rely on usb_tx()
Glancing...
I understand that. That's why we're looking to use a Teensy as a USB to Serial device in our setup (to replace the FTDI).
Hence the questions about improving code efficiency.
Is there a...
Well.... I'll try to answer the best I can bc the issue is not just plain latency. So more details:
We are running a master-slave setup at 1Mbps baud, where the master (in this case the PC, via...
Hi all,
I am starting work on a project where I will be using a Teensy LC to act as a USB to Serial converter with a twist: the Teensy LC will need to intercept and tweak communication for the...
I have now been able to get a more clear undersatding of what is gong on in my case.
Before I continue I have determined my versions: Arduino 1.0.6 and Teensyduino 1.25. I know these date far back...
Thank you for the advice.
I will look into your advice and post more information.
Hi Paul,
I missed your other posts after this one as I was not in the office Friday and basing myself on your timing.
In any case, I have the screenshot now.
Feel free to address this as you...
A Google Search (as I don't have equipment with me) has shown a few related posts:
https://freescale.jiveon.com/thread/388930
https://community.nxp.com/thread/312294
(I'm a bit at a loss if this...
Hi Paul,
Thank you very much for taking the time to look into this.
I would gladly send you a screenshot of the Logic Analyser as a picture's worth a thousand words but I'm not at the Office...
Let me add that the code above still doesn't fully resolve the issue;
I've now added the interrupts for ORIE and FEIE (interrupts for both exceptions) but the UART still halts after a FE, despite...
Hi
I'm using Teensy 3.2 and we're doing a long term project with teensy.
We've recently come across a situation that's not handled by the Teensiduino library we use and causes de UART to stop...
Hi Kurt,
I ended up going the road of writing my own bit banged Serial Library to just cope with this. ATMEL AVR305 and 304 (bot mostly 305) application notes have a very good explanation and...
Hi
We've been working on a time sensitive application where we need to react every 25 microsecs (should be easy enough for T3.2 @96Mhz).
We were having occasions where we the processor would...
Good point. I'll give it a try and let you know.
( I don't have high hopes though, bc teensy is actually timing correctly; I think this is more of an issue of the other device, but it's definetly...
Hi Kurt,
Thank you for your reply.
I have been using Teensy's half duplex uart capability for quite a while, using the LOOPS mode as well. In my case I have modified the serial1.c and serial2.c...
Hi all,
We're using teensy 3.2 to work as a bridge to upgrade a slave device connected to it over serial (one wire/half duplex uart). The slave device has a one wire bootloader (tinysafeboot) and...
Hi all
(Preliminary note: there is an answer to a similar topic on the main PJRC site but it only applies to ATMEL processors I believe (https://www.pjrc.com/teensy/interrupts.html), so I have...
Hi all
Although it may seem I'm reviving this old thread, the question at hand is actually quite pertinent.
We are building our boards using Teensy 3.2 and using our own programmed interface to...