deep

a Cross Development Platform for Java

User Tools

Site Tools


runtime_library:using_serial_out:start

This is an old revision of the document!


Using Serial Out (System.out)

On the hardware side

Freescale MPC555

The Freescale MPC555 offers two independent serial interfaces with RS232 Protocol, SCI1 and SCI2. When using our NTB MPC555 Headerboard, the SCI1 is connected through the 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

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

  1. 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:
    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("Hello, world");
    	}
    }
  2. On the host you have to determine which port number your operating system has assigned to the port
  3. Open any terminal program, such as putty, Hyperterminal or realterm. Configure the port setting similar to the target setting and open the connection.
  4. Alternatively, in eclipse you can use the terminal view. Open View Dialog under Window → Show View → Other

In the category Terminal mark Terminal and confirm with OK. Under Connection Type select Serial and choose settings according to the settings of the SCI on the target.

  1. In order to use the terminal in eclipse you have to install the appropriate plugin, see Eclipse Serial Terminal. If you use our eclipse distribution this plugin is already included.
runtime_library/using_serial_out/start.1429539194.txt.gz · Last modified: 2016/02/25 13:33 (external edit)