Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 21948

Write to I/O pin in fewest number of clock cycles

$
0
0

I am trying to write to a standard MSP430 I/O pin in the fewest number of clock cycles possible. Obviously for a single pin I can only drive a 1 or 0. The fastest that I've been able to write to these I/O pins is 3 clock cycles both for C and for assembly.

The C code is:

P6OUT = 1;
P6OUT = 0;

The assembly code that I have tried is:

//Initialize
asm(" MOV.B #1, R7");
asm(" MOV.B #0, R3");
...
//Each of these instructions takes 3 clock cycles
asm(" MOV.B R3, &PCOUT_H");
asm(" MOV.B R7, &PCOUT_H");

My question is, can I write to an I/O pin any faster?


Viewing all articles
Browse latest Browse all 21948

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>