AMD186 & SCC2692 Comm Code

This code was modified for these UARTs based on the serial communications code from the book Embedded Systems Building Blocks by Jean Labrosse, who also created UCOS-II.  The code is meant to run in a UCOS-II environment.  As written the code will not support all 4 comm ports at once since both modules assume a COMM1 and COMM2.  Changing one for COMM3 COMM4 should be straight forward.  The included asm file was written for the "improved" interrupt service routine style as described on the ucos-ii web site.  The CommCfgPort baud function parameter was changed to an INT32U from an INT16U to allow setting of baud rates above 65k.  Two new files called comm_util.h/c were added, currently only one additional function is defined CommPutChars(), which writes a buffer to the serial port.

You should modify your ucos-ii cfg.h file to contain the following:

#if MODULE_COMM_AMD
#define COMM1_BASE 0xFF80 /* Base address of AMD186ES COM1 */
#define COMM2_BASE 0xFF10 /* Base address of AMD186ES COM2 */
#define COMM_MAX_RX 2 /* Maximum number of characters in Rx buffer of ... */
#define COMM_PROCESSOR_FREQ 40000000 /* Processor speed, used in baud calc */
#endif
#if MODULE_COMM_SCC2692
#define COMM_SCC_BASE 0x0500 /* I/O address of SCC uart chip on tern board */
#define COMM1_BASE 0x0000 /* Base address of Channel A on SCC2692 */
#define COMM2_BASE 0x0010 /* Base address of Channel B on SCC2692 */
#define COMM_MAX_RX 4 /* scc2692 has 3 byte buffer + shift reg */
#endif


Then in your includes.h add:

#define MODULE_COMM_AMD 0 /* Asynchronous Serial Communications module */
#define MODULE_COMM_SCC2692 1 /* Asynchronous Serial Communications module */
#if MODULE_COMM_AMD
#include "\software\blocks\comm\source\comm_amd.h"
#include "\software\blocks\comm\source\comm_util.h"
#endif
#if MODULE_COMM_SCC2692
#include "\software\blocks\comm\source\comm_scc2692.h"
#include "\software\blocks\comm\source\comm_util.h"
#endif


esbbcomm.zip  After unzipping place the files in the \Software\Blocks\Comm\Source directory.

...develop, race, win!