01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Top of list<br />

Index page<br />

b) The current stack must be pre-initialized for math emulation:<br />

void my_emu1st(void)<br />

{<br />

asm{<br />

mov word ptr ss:[0x2f],0x0065 // set end of FPU stack<br />

mov word ptr ss:[0x31],0x0125 // set start of FPU stack<br />

mov word ptr ss:[0x27],0 // no protected mode<br />

mov byte ptr ss:[0x26],0 // no 8087<br />

}<br />

}<br />

c) Before executing floating point arithmetic, call the Borland library function _fpreset, which<br />

initializes the stack for floating point emulation.<br />

Example for a task function:<br />

void huge my_task(void)<br />

{<br />

float a;<br />

my_emu1st();<br />

_fpreset();<br />

// ..... ready for executing floating point arithmetic<br />

}<br />

If you are interest in more details, take a look at the Borland 5.02 RTL sources (fpinit.asm).<br />

We will provide an example for using floating point arithmetic in separate tasks or within CGI<br />

callbacks.<br />

3. Using Math emulation with Borland C++ 5.02 (also for older versions of Borland C) produces a<br />

conflict between the NMI interrupt of the <strong>@CHIP</strong>-<strong>RTOS</strong> (Interrupt Vector 0x02) and the Borland<br />

floating exception handling. Borland C math emulation also uses INT 2 for generating floating<br />

point exceptions. Our internal NMI interrupt service function (normally called at power fail case)<br />

will no longer execute during the runtime of the user's application. We have provided a solution<br />

which moves the Borland exception function from INT 2 to another interrupt vector. We modified<br />

the Borland RTL source (fpinit.asm) and include the modifications directly into the application<br />

project. It is planned to provide an example in our Internet download area.<br />

Configure PPP client or server<br />

1. Connected modems should be configured in chip.ini with the modem command ATE0 INITCMD.<br />

This prevents the modem from echoing characters to the peer in command mode. The COM and<br />

the serial ports of the <strong>IPC<strong>@CHIP</strong></strong> have only 4 lines (TxD/RxD/CTS/RTS) and no line for detecting<br />

a hang-up of the modem. Because of this fact we provided the Idletimeout and the<br />

MODEMCTRL configuration features in chip.ini or in the PPP client init structure type. But the<br />

idletimeout and modemctrl detection can fail if a modem has switched its echo mode on. If<br />

the peer modem hangs up without correctly closing a PPP session, the IPC@chip modem also<br />

hangs up and goes into the command mode. Because of the missing line for detecting a modem<br />

hang-up, the PPP server doesn't know anything about the broken connection and still sends PPP<br />

frames to the modem. It can happen that the modem echoes these characters back to the<br />

<strong>IPC<strong>@CHIP</strong></strong> due to being in "Echo on" mode. This will cause the idletimeout to not work.<br />

2. We recommend that the PPP server or client and the connected modems should run (if possible)<br />

with RTS/CTS flow control (see chip.ini flow control mode or the PPP client init structure type).<br />

Page 14 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!