deep

a Cross Development Platform for Java

User Tools

Site Tools


runtime_library:using_serial_out:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
runtime_library:using_serial_out:start [2018/06/12 08:21] ursgrafruntime_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 side =====+See [[firstexample:start|Hello World with System.out]] to understand how to configure one of the available serial interfaces and direct your standard output onto this stream. On the host side you have to determine which port number your operating system has assigned to the port. Open any terminal program, such as //Putty//, //Hyperterminal// or //Realterm//. Configure the port setting similar to the target setting and open the connection.
  
 ==== Freescale MPC555 ==== ==== Freescale MPC555 ====
- +The Freescale MPC555 offers two independent serial interfaces with RS232 Protocol, SCI1 and SCI2. When using our [[http://wiki.bu.ost.ch/infoportal/embedded_systems/mpc555/headerboard/start | NTB MPC555 Headerboard]], the SCI1 is connected through the [[http://wiki.bu.ost.ch/infoportal/embedded_systems/mpc555/usb-bdi | USB Background Debugging Interface (USB-BDI)]] to the host where it will be visible as a virtual COM port. The SCI2 can be connected with a standard serial cable (DB9 connector).
-The Freescale MPC555 offers two independent serial interfaces with RS232 Protocol, SCI1 and SCI2. When using our [[http://wiki.ntb.ch/infoportal/embedded_systems/mpc555/headerboard/start | NTB MPC555 Headerboard]], the SCI1 is connected through the [[http://wiki.ntb.ch/infoportal/embedded_systems/mpc555/usb-bdi | USB Background Debugging Interface (USB-BDI)]] to the host where it will be visible as a virtual COM port. The SCI2 can be connected with a standard serial cable (DB9 connector).+
  
 ==== 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 serial communication interface with the desired settings and assign the standard pipes (in, out, err) to this port. Example for the MPC555:  +The Zynq 7000 has two built-in UART'and allows to use further UART's by using flink devices located in the FPGAsee [[https://flink-project.ch/]]. For further details see [[runtime_library:drivers:start#Universal_Asynchronous_Receiver/Transmitter_(UART,_RS232)|Device Drivers]].
-<code java> +
-import java.io.PrintStream; +
-import ch.ntb.inf.deep.runtime.mpc555.driver.SCI1; +
- +
-public class HelloWorld { +
- static { +
- // 1) Initialize SCI1 (9600 8N1) +
- SCI1.start(9600, SCI1.NO_PARITY, (short)8); +
-  +
- // 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("Helloworld"); +
-+
-+
-</code>  +
-The maximum allowed baudrate for the SCI1 is 38400 when using our [[http://wiki.ntb.ch/infoportal/embedded_systems/mpc555/usb-bdi | USB Background Debugging Interface (USB-BDI)]]. This is caused by the fact that the serial signals are handled by the rather slow microcontroller on this interface board. +
-\\ \\ +
-When working with the the mpc5200: +
-<code java> +
-import java.io.PrintStream; +
-import ch.ntb.inf.deep.runtime.mpc5200.driver.UART3; +
- +
-public class HelloWorld { +
- static { +
- // Initialize UART (9600 8N1) +
- UART3.start(9600UART3.NO_PARITY, (short)8); +
-  +
- // Use the UART3 for stdout +
- System.out = new PrintStream(UART3.out); +
-  +
- // Print a string to the stdout +
- System.out.println("Hello, World"); +
-+
-+
-</code>+
  
-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//, //Hyperterminal// or //realterm//. Configure the port setting similar to the target setting and open the connection. 
  
runtime_library/using_serial_out/start.1528784502.txt.gz · Last modified: 2018/06/12 08:21 by ursgraf