This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
runtime_library:using_serial_out:start [2015/04/20 16:15] – [On the software side] ursgraf | runtime_library:using_serial_out:start [2022/12/20 11:17] (current) – ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using Serial Out (System.out) ====== | ====== Using Serial Out (System.out) ====== | ||
- | ===== On the hardware | + | See [[firstexample: |
==== Freescale MPC555 ==== | ==== Freescale MPC555 ==== | ||
- | + | The Freescale MPC555 offers two independent serial interfaces with RS232 Protocol, SCI1 and SCI2. When using our [[http:// | |
- | The Freescale MPC555 offers two independent serial interfaces with RS232 Protocol, SCI1 and SCI2. When using our [[http:// | + | |
==== Freescale MPC5200 ==== | ==== Freescale MPC5200 ==== | ||
The Freescale MPC5200 has six built in Programmable Serial Controllers (PSC), which can all work as UART's running the RS232 protocol. Check your hardware manual to see which of the PSC can be used on your board. | The Freescale MPC5200 has six built in Programmable Serial Controllers (PSC), which can all work as UART's running the RS232 protocol. Check your hardware manual to see which of the PSC can be used on your board. | ||
- | ===== On the software side ===== | + | ==== Zynq 7000 ==== |
- | - In your application on the target you have to initialize | + | The Zynq 7000 has two built-in UART's and allows |
- | import java.io.PrintStream; | + | |
- | import | + | |
- | + | ||
- | public class HelloWorld { | + | |
- | static { | + | |
- | // 1) Initialize SCI1 (9600 8N1) | + | |
- | SCI1.start(9600, SCI1.NO_PARITY, | + | |
- | + | ||
- | // 2) Use SCI1 for stdout and stderr | + | |
- | System.out = new PrintStream(SCI1.out); | + | |
- | System.err = new PrintStream(SCI1.out); | + | |
- | // 3) Say hello to the world | ||
- | System.out.println(" | ||
- | } | ||
- | } | ||
- | </ | ||
- | import java.io.PrintStream; | ||
- | import ch.ntb.inf.deep.runtime.mpc5200.driver.UART3; | ||
- | public class HelloWorld { | ||
- | static { | ||
- | // Initialize UART (9600 8N1) | ||
- | UART3.start(9600, | ||
- | |||
- | // Use the UART3 for stdout | ||
- | System.out = new PrintStream(UART3.out); | ||
- | |||
- | // Print a string to the stdout | ||
- | System.out.println(" | ||
- | } | ||
- | } | ||
- | </ | ||
- | - On the host you have to determine which port number your operating system has assigned to the port | ||
- | - Open any terminal program, such as //putty//, // | ||
- | - Alternatively, | ||
- | In the category // | ||
- | - In order to use the terminal in eclipse you have to install the appropriate plugin, see [[http:// |