DS80C400 C Libraries: Development Issues

  1. When writing an interrupt in 8051, make sure to preserve DPS and PSW. Consult the DS80C400 User's Guide for information on proper values of these registers for your use.
  2. When using interrupt code written in C, make sure the Keil project option Use Multiple DPTRs is checked so that DPS is preserved.
  3. Applications that use the the socket libraries should call the clear_param_buffers function immediately after calling the init_rom function.
  4. To increase the accuracy of the system millisecond timer, call the function task_settickreload soon after rom initialization.
  5. If your application uses multiple processes, turn off the overlay analyzer in the Keil tools. This can be done in the Project Target Options dialog, under the LX51 Misc panel. Type the word NOOVERLAY in the edit box labeled Misc Controls:.
  6. If you are having problems with keeping network connectivity after a reset, this message may apply: http://lists.dalsemi.com/maillists/tini/2003-May/026053.html.
  7. If you write any 8051 code that will be called from C, note that pointers as they are passed down from C code aren't immediately usable in 8051, and pointers that are usable in 8051 must be altered before they are suitable for C use. Use the macro FIXKEILPOINTER to change the high byte of a pointer passed down from C into something usable in 8051. For example, if the pointer is passed to assembly in r3:r2:r1...
                   FIXKEILPOINTER r3           
    The parameter should be the register or direct that contains the high byte of the pointer. To alter a pointer back so it can be returned to the C program...
                   UNFIXKEILPOINTER r3           
  8. Do not initialize any variables declared as 'data' (that is...any variables in internal RAM) until after the init_rom function has been called. Variables declared as 'data' will be initialized to zero when init_rom is called.
  9. If your applications cannot create more tasks or accept more sockets and you have plenty of RAM, you have probably run out of kernel memory. Use the new Kernel Memory Allocation library to increase the amount of kernel memory your application uses.
  10. Make sure that you do not mix the Keil memory allocation and de-allocation routines with the Dallas Memory Management de-allocation and allocation routines. These allocation routines have very different memory structures and draw from different pools of memory.
  11. The power-fail-reset bit and the watchdog-reset bit are not available for application use. They are saved at data location 21h before application code starts running. The watchdog-reset bit is stored in bit 4 of data location 21h, and the power-fail-reset bit is stored in bit 3 of data location 21h. This information will be destroyed when the ROM task scheduler is initialized, so these values should be stored in XDATA if needed before any ROM initialization functions are invoked.
  12. When writing applications using UDP sockets, note that even if you don't actively call the recvfrom function, the network stack will store received messages to an active socket, which consumes kernel buffers. It is probably a good idea to occasionally call recvfrom to make sure that those kernel buffers are free.
  13. Many Keil provided functions are not safe to be called from multiple processes. For instance, String formatting functions such as printf and sprintf should not be called from multiple processes without some kind of concurrent access protection.