Hi all,
following issue: Teensy 3.0 should work as logic analyser. Fastest possible sampling rate whilst streaming results via USB to PC.
So I've set up the PIT0 timer to sample the data port via pit0_isr into a run-length encoded circular buffer, from which the main loop fetches it and writes it to the PC.
Unfortunately the pit0_isr takes about 1.2 us even after optimisation.
So I've rewritten pit0_isr into ARM assembler (not Thumb) for maximum speed. On the main path I'm now at 18 cycles code, not including the b lr at the end.
Now my questions:
I'll continue to investigate, but some help would be appreciated at this stage.
Kind regards,
Sebastian
following issue: Teensy 3.0 should work as logic analyser. Fastest possible sampling rate whilst streaming results via USB to PC.
So I've set up the PIT0 timer to sample the data port via pit0_isr into a run-length encoded circular buffer, from which the main loop fetches it and writes it to the PC.
Unfortunately the pit0_isr takes about 1.2 us even after optimisation.
So I've rewritten pit0_isr into ARM assembler (not Thumb) for maximum speed. On the main path I'm now at 18 cycles code, not including the b lr at the end.
Now my questions:
- I seemingly can't integrate my pit_assembler.S file into the Teensy Beta8 Arduino IDE. Any idea how to overcome this?
- I can't call my pit0_isr easily from C++ anymore in order to measure its speed, I'm getting "Conflicting CPU architecture" from ld. Can I declare a procedure as ARM somehow, such that the proper bx call sequence is generated at the calling side?
- Can someone with more experience confirm that ISR routines in ASM assembler are valid on the Cortex-M4? Which type of jump is contained in the vector table?
- Is the b lr contained in the 12 cycles minimum ISR overhead that I read somewhere in the ARM docs? Do the 12 cycles apply in this case, making my code take 30 cycles on the main path?
I'll continue to investigate, but some help would be appreciated at this stage.
Kind regards,
Sebastian