Flameman/tinijava-390

From eLinux.org
< Flameman
Revision as of 08:54, 10 July 2011 by Flameman (Talk | contribs)

Jump to: navigation, search

For more interesting projects done by Flameman, be sure to check out his project index

tinijava-390-Flameman

Note

I'm developing for this board, the wiki page will be improved soon

feel free to contact me (see the contact below)

Introduction

TINI (for TIny Network Interface) is a complete TCP/IP node with a Java JVM all on a $50 SIMM module produced by Dallas Semiconductor. The controller is the DS80C390.

TINI includes, all on board:

  • Flash
  • NVRAM
  • ethernet
  • RS232
  • CAN and iButton
  • Java JVM

All it needs is power and connectors.

the board firmware runs a tini java virtual machine, which is pretty able to boot to board, to upload java application, and to run it

The Target-goal of this page is

  • have appeal with it
  • have experience with I/O driver written in java (do you really think it i impossibile ?)


People you could contact if you need help

  • flameman, i'm currently use this board for a project, email
    • email flamemaniii@gmail.com
  • you ... if you want ;-)

About this project

About the board

Overview

The board consists of:

Memory Locations

memory map of the board will be added as soon as possible


addr begin addr end area
...  ?? ram, userspace


Open questions


...

Problems

...


getting the toolchain

see http://forums.gentoo.org/viewtopic-t-688852-start-0.html

Images of the board

Tinijava-390-mobo.jpg



About

what/where

About firmware

About devtools

javac-390translate java to pseudo 51 assembly

  • javac-8051 machine layer has been ported to 80c390, but there is no public assembler
  • dalsemi has released a java version of java compiler and 51 assembler and linker

modern java environment are not compatible with java-51-assembler

so if you need this old java environment email me i will provide the java binary

doc

tinijava Books

Tinijava-book.jpg


Unofficial Bug List

Common problems and Gotchas

Tips & Tricks

draft

hAllo world

Sends hAllo world blinkig the CPU LED, with echo of the command line args

This code has been tested to work with Tini-v1.0


package hello_first;

import com.dalsemi.comm.*;
import com.dalsemi.system.*;
import com.dalsemi.jellybeans.*;

public class hello_world
{

  // our default constructor
  public hello_world()
  {
  }

  // a method we are adding
  static void PrintHello () throws Exception
  {
    System.out.println("hAllo World from TINI");
  }

  public static void main(String[] args)
  {
    hello_world hello_world1 = new hello_world();

    try
    {
        System.out.println("My First Program Starting");
        hello_world1.PrintHello();
        System.out.println("Normal Exit");
    }
    catch (Throwable e)
    {
      System.out.println("Exception");
      System.out.println(e);
    }
  }
}


Flash TINI LED

This program flashes TINI's LED D1, the CPU LED on P3.5. This is also the internal 1-wire signal and the 16X IrDA clock, so some values of flash timing will probably conflict with other uses of P3.5.

CPU status LED(D1) is connected to CPU.port3.bit5

This code has been tested to work with Tini-v1.0



package flash_led;

import com.dalsemi.comm.*;
import com.dalsemi.system.*;
//import com.dalsemi.jellybeans.*;


public class flash {

  public flash() {
  }

  public static void main(String[] args) {
  //TINIOS is a static method and can't be instantiated.
  //TINIOS OS = new TINIOS();                                       //get a reference to the TINI OS
  byte LEDselect = com.dalsemi.system.BitPort.Port3Bit5;          //set LEDSelect to selection code for the CPU status LED D1
  BitPort LEDdrive = new com.dalsemi.system.BitPort(LEDselect);   //get a reference to TINI CPU P3.5

  while (true){                   // forever
    LEDdrive.clear();               // LED off
    TINIOS.sleepProcess(1000);          // wait for 1 second
    LEDdrive.set();                 // LED on
    TINIOS.sleepProcess(1000);          // wait for 1 second
    }
  }
}

fuffa

doing a project sing a "TINI Board" which is a 10 year old peice of gadgetry which hosts a web server, and using java applets, one can control the outputs (in this case LEDS) using java.

the following turns on a yellow LED, which i am taking the output to control a relay and do various things...

manip.add(LEDManip.Y1);
lcdmanip.clear();
lcdmanip.out.println("Current Move:");
lcdmanip.out.print("Elbow Down");
lcdmanip.out.flush();
pause(5000);

In the following code


import com.dalsemi.system.*;
import java.net.*;
import java.io.*;
import com.taylec.tini.*;
import com.taylec.tini.io.*;
import java.lang.*;
import java.util.*;
import com.dalsemi.system.TINIOS;
import java.util.Enumeration;

public class elbowdown
{
/**
* Pause
*/
private static final void pause(int delay_)
{
try
{
Thread.sleep(delay_);
}
catch (InterruptedException e_)
{
}
}

public static void testLED(Interrupt interrupt_)
{
try
{
LEDManip manip = new LEDManip();
LCDManipFormat lcdmanip = new LCDManipFormat();

//setup local variable to use for state manipulation of LEDs
int cur_state = 0;

//turn off the LEDs
manip.clear();

manip.add(LEDManip.Y1);
lcdmanip.clear();
lcdmanip.out.println("Current Move:");
lcdmanip.out.print("Elbow Down");
lcdmanip.out.flush();
pause(5000);



manip.subtract(LEDManip.Outer);
while(true)
{ manip.subtract(LEDManip.Inner);
if (interrupt_.getNumEvents()>0)
{
return;
}
}
}
catch (IllegalAddressException err_)
{
System.out.println(err_.toString());
}
}


public static void main(String args[])
{
Interrupt interrupt = new Interrupt();

System.out.println("Starting Motion");
testLED(interrupt);
System.out.println("Ending Motion");
System.exit(0);

}
}

When i run that code, the program continues to run and stuffs up the next one from running, so i need it to exit without having to use the interupt (a button on the TINI board) I thought it would be logical and just have the import part, then the function definition, then the LED control part, then the function stops, however when trying to remove bits, i keep getting errors.

App

bareboard