TDC Home PageAbout TDCContact usNewsTechnicalWeb Sales
Click Here to Select Products by Manufacturer
Click Here to Select Products by Technology
 

Here I will place useful information for developers using the TC45. There are also some compiled example programs which may be of use. Source code is available to registered TDC customers using the TC45 upon request.

As we have more programs, or gather more useful information, I will update this page, so it will be worth bookmarking the page and visiting from time to time.

Development hints General information for setting up your development environment for the TC45
Externalcommands.jar Java program which adds an extended AT command set mainly for TCP/IP connections
miodem.jar Simple I/O control program
Setting and switching off Autostart A common question!
Example circuit How to control the ignition line
 
TC45 V1.02 SDK and V02.02 firmware
 

The new SDK and firmware is available from us. In particular, this code offers the following new features (in addition to many others) :

  • AT^SCFG automatic command execution
  • Improved Copy protection for application software
  • Character framing - 8N1, 8O1, 8E1, 7O1, 7E1

New improved documentation, a new SDK and firmware is also available.

A demonstration program showing email (pop3), and ftp is also now provided in addition to the existing demonstration programs.

This code is available to TDC customers via the following links. Please contact your sales representative for the information needed to download these files.

TC45 V02.02 release notes (1MB)
TC45 SDK V1.02 (85MB)
TC45 V02.02 Firmware (2MB)
TC45 V02.02 Documentation (5MB)
 
TC45 Development Hints
 

The following is intended as some practical help when developing with the TC45. More detailed information is available in the Siemens Java User's Guide.

SDK Installation
Install Sun ONE and the J2ME compilers BEFORE you install the Siemens SDK - it will detect the prescence of the compilers and add all the extra libraries for you. These compilers and the Sun One IDE can be downloaded from http://java.sun.com/j2me/.

Development Environment
Consider carefully the development approach used. Although devices such as the MTC45TC provide a good development platform, it may be better to use more complete devices such as the Siemens DSB. The DSB allows the developer to isolate any or all of the pins of the TC45. This means that the hardware can be gradually integrated with the new target system. For example, power supplies can be a critical part of a board design, and it may be better for the software writers to make a start on the software while the hardware is being developed. The DSB will allow you to connect logic lines to the target application while wtill using a tried and tested power supply design.

Embedded Systems
For JAVA programmers coming from the PC environment to the embedded environment, please remember that the TC45 has some differences when compared to a PC! Although there is a filing system on board which appears like a hard disk, it should not be used in the same way as a hard disk may be used for 'scratch' information. The 'disk' on the TC45 is in Flash memory, which has a finite number of read/write cycles, in the order of 100,000. Therefore, files should be written to the memory relatively infrequently, maybe on power-up/down or when a significant amount of data has been collected. Using this memory instead of the RAM as a scratchpad is not encouraged.

Simulators
Siemens provide a PC simulator so that you can run JAVA code on a PC (which has some trace & debug advantages). However, you must remember that compared to an embedded system, the PC will have some disadvantages, such as not being fully integrated with the target hardware. The TC45 does communicate with the PC using the serial interface, so that the I/O can still be operated via the AT commands. One advantage of using the simulator is that you can monitor the serial interface using something like PortMon, but I find that for most of the development process that PC simulators are a hinderance! They may well protect you from other vagaries like power supply defects, network and connectivity issues to name just a few.

Serial Port Switch or Two Com Ports
This will make life easier when developing. Don't forget that ASC0 is principally used to connect to a PC to drag-and-drop code, and ASC1 as the application port. If you are monitoring the application output using a PC, then swapping serial cables becomes a pain, so a second serial port is the preferred option!

RTFM
The Siemens manuals are very complete and should actually contain everything you need. The main problem, is they are quite large - so sometime just finding the information you need can be a challenge, but I assure you, it is normally there!

OTAP
This is something I often get questions about. Get one parameter wrong, and it does not work. This configuration works well, with these AT commands on the modem :

at^scfg="Userware/Passwd","","password","password"
// Set the OTAP password (you may not want to use the word 'password'!
at^scfg="Userware/Autostart","password","1"
// Set the program to autostart
at^scfg="Userware/autostart/appname","password","a:/ota/rs232demo.jar"
//Where the program will be installed
at^scfg="Userware/autostart/delay","password","10"
// delay after power up to program start

The SMS message then sent to the TC45 is like this :
OTAP_IMP1.0/x0aPWD:password/x0aAPPDIR:a:/ota/x0a
JADURL:http://www.tdc.co.uk/java/rs232demo.jad/x0a
BEARER/x0aAPNORNUM:internet/x0aNETUSER:web/x0a
NETPWD:web/x0aSTART:install

(all sent as one line, one SMS)

Both the JAD and the JAR files are expected to be present on the web at the appropriate URL - www.tdc.co.uk/java in this example, replace this with the right directory.

Reference Books
These JAVA reference books have been used and have proven to be of great value, you can easily buy them from Amazon.
JAVA 2 in easy steps
J2ME in a Nutshell

J2ME: The Complete Reference
Core J2ME Technology & MIDP (Sun)

Disclaimer: The above is purely Bob's own opinion, based on many years experience in developing code for embedded systems. Individual developers may wish to ignore these suggestions, but Bob thinks you should at your own peril!

 
TC45 Application - externalcommands.jar
 

This program adds AT commands to the TC45. One extension in particular allows the modem to connect directly to a remote TCP/IP address using a modified dial command. The resultant connection to the TCP/IP socket allows data applied at the serial port of the TC45 to be transmitted seamlessly to the remote TCP/IP address.

The program will also keep a GPRS connection open, avoiding the 30 second connection termination often applied by the networks.

Don't forget that the application runs via ASC1, the second serial port on the TC45. You will get some debug and monitoring messages appear on ASC0 though.

Download - Full documentation is included within the downloadable file

Programs provided as demonstration utilities by TDC are provided on an 'as is' basis. No liability whatsoever is accepted for their use, nor will support necessarily be provided. Source code may be provided to regular customers of TDC upon request.

 
TC45 Application - miodem.jar
 

This program allows the TC45 to control I/O lines simply by receiving a caller ID from an incoming call. The call is rejected and the I/O line operated.

Download - Full documentation is included within the downloadable file

Programs provided as demonstration utilities by TDC are provided on an 'as is' basis. No liability whatsoever is accepted for their use, nor will support necessarily be provided. Source code may be provided to regular customers of TDC upon request.

 
Setting and Switching off Autostart
 

To set autostart on your Java application, you basically need two commands :

at^scfg="Userware/Autostart/Appname","",
"a:/your_application_name.jar" (all as one line)
at^scfg="Userware/Autostart","","1"

Enter these two commands (with the correct path for your application - a:/ is the root folder of the TC45), and the program will autostart every time the module is switched on.

Then, a common request I get is how to switch OFF autostart once it is running!

Once Autostart is enabled, the modem will always run the selected autostart program. One way to stop it is to use OTAP and delete the old program, or to use the "Switch Autostart Off" program supplied with the SDK.

Simply run the program, make sure your TC45 is connected to the PC via ASC0 (the first serial port on the TC45), and then switch the TC45 on. The program will detect the connected modem, and disable the autostart for you.

Disclaimer: The above is purely Bob's own opinion, based on many years experience in developing code for embedded systems. Individual developers may wish to ignore these suggestions, but Bob thinks you should at your own peril!

 
Ignition circuit
 

Some customers have asked for an example ignition circuit.

One is shown below as a suggestion, of course you may prefer to modify it slightly.

Disclaimer: The above is purely Bob's own opinion, based on many years experience in developing code for embedded systems. Individual developers may wish to ignore these suggestions, but Bob thinks you should at your own peril!

 
 

Registered in UK No. 1065925    VAT No. 200 6983 82     TDC is a trading name of Abacus Electronic Holdings Ltd. Registered Office: Abacus House, Bone Lane, Newbury, Berkshire, RG14 5SF, UK.
Tel: +44 (0)1256 332800   web.sales@tdc.co.uk   Copyright © TDC 2005
March 31, 2005