Interrupt hardware connection

I want to read the telemetry signal from an Castle Creations Edge speedcontroller.
The Rx sends an inverted pwm signal to the ESC and the speedcontroller pulls the line low for a very short moment between 500 and 5500 us after the rising edge of the pwm pulse.

When attached to INT0 and an interrupt on the falling edges gives me the elapsed time between two interrupts, this is enough input to calculate the telemetry data.

My question: What happens if I replace the Rx with a pwm coming from the same microcontroller that I am using for reading the interrupt. Can I attach pin 10 (pwm) directly to pin 2 (interrupt) or do I risk blowing up my UNO?

Testing without using the sensor?

The board creates the pwm output, the speedcontroller the telemetry tick on the pwm line. The falling edge of the pwm is useless as the microcontroller creates the pwm and already knows there is a falling edge to the pwm. The speedcontroller pulls the line down after a number of microseconds and the time elapsed between the rising edge of the inverted pwm pulse and the falling edge of the telemetry tick tells the value of the telemetry output. There are 11 telemetry ticks for voltage, amps, rpm etc and one without tick to synchronise. Using the same microcontroller allows me to activate the speedcontroller and display the telemetry values so I can test different engine loads and still monitor how the speedcontroller behaves.

Telemetry is normally used in flight with warnings if things get too hot, overloaded, empty but while flying I do not have the time to read all info. A test stand will help to stay within safe limits before I take off.

castle_link_live_2_0.pdf (536.7 KB)

The microcontroller acts as Rx and makes the inverted pwm, the esc reacts and set the requested motor output en uses the Rx line to pull down to send the telemetry data. So there is only one wire with the signal.

Seems ok, I will try that with an UNO.

Not really :frowning:

If the ESC can pull the line low then the Arduino output pin must be reverted to an input pin for that time. Otherwise there is a short circuit between the Arduino and ESC output pins, with the Arduino pin killed sooner or later.

What if I use a single wire to pin(9) and modify the pinMode(9,OUTPUT) to pinMode(9, INPUT_PULLUP) at the end of the pwm pulse and then use PCINT1 interrupt to signal the tick. Once the tick passed the pin goes back to pinMode(9, OUTPUT).

There is between 500 and 5500 us between the end of the pwm and telemetry tick. The pwm comes every 20 ms and lasts between 1-2 ms.

Challenges:

  • 3.3V on the output pin will require a different board
  • the start pulse has no tick
  • PCINT1 is not supported by Arduino but can be configured manually

Sounds like a project

No, 16MHz require 5V. A Pro Mini will work with 8MHz @ 3.3V

That sounds like a plan, thanks for guiding my thoughts. I always assumed that pinMode was something you would do in setup and leave it unchanged.

Now reading the documentation it makes sense to me. All that is left is to make some software.

Requirement

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.