I just got an HD44780 working with my RCM5700 via AUX_IO. Though there are some port differences from the RCM3000, perhaps these code fragments will help. I used external port 0x8001 with PE4 specified as the I/O strobe. PE4 is not brought out to the connector on the RCM5700 so I used IOWR for the actual strobe to my 74HCT273 latch. My HD44780 is using 8-bit data mode.
The first line – #define PORTA_AUX_IO – is required on the RCM5700 and on all Rabbit boards, I think, for setting up the AUX_IO routines. The other initialization statements in main() are also required to set up the Rabbit hardware.
Note that I used this in a COSTATE, so I had to use COFUNC and WFD and WAITFOR statements. It complied with DC_10.44.
One thing I noticed in your code is that you used mutliple port addresses (0xC000-0xC006). They should probably all be to the same port, wherever your HD44780 is connected.
Good luck!
#define PORTA_AUX_IO // required to enable auxiliary I/O bus
#define LCD_EN 1 // Register Select port B bit 1
#define LCD_RS 2 // Read/Write signal port D bit 2
#define LCD_RW 3 // Enable signal port D bit 3
#define Cmd 0 // LCD Command mode
#define Data 1 // LCD Data mode
#define Lcd_Clear 0x01
#define Lcd_solidCursor_On 0x0E
#define Lcd_noCursor_On 0x0C
#define Lcd_blinkCursor_On 0x0F
#define Lcd_Cursor_Home 0x03
#define Lcd_Off 0x08
cofunc void LcdWrite(int mode, char hex);
cofunc void LcdWrite(int mode, char hex) {
BitWrPortI(PDDR, &PDDRShadow, mode, LCD_RS); // Set LCD cmd/data mode
BitWrPortI(PDDR, &PDDRShadow, 0, LCD_RW); // Set LCD write mode
WrPortE(0x8001, NULL, hex); // write LCD command to 0x8001
waitfor(DelayMs(1));
BitWrPortI(PBDR, &PBDRShadow, 1, LCD_EN); // Start sending data
waitfor(DelayMs(1)); // Wait 1 ms for LCD to read
BitWrPortI(PBDR, &PBDRShadow, 0, LCD_EN); // Finish transmission
waitfor(DelayMs(1)); // Wait 1 ms until next write
}
main()
{
// SlavePortControlregister
WrPortI(SPCR, &SPCRShadow, 0x8C); // Enables AUX I/O
// I/O Bank Control Reg to use 0x8000
WrPortI(IB4CR,&IB4CRShadow, 0x6A); // 7 ws /iowr active low
// Initialize LCD controls to output
BitWrPortI(PBDDR, &PBDDRShadow, 1, LCD_EN); // port B
BitWrPortI(PDDDR, &PDDDRShadow, 1, LCD_RS);
BitWrPortI(PDDDR, &PDDDRShadow, 1, LCD_RW);
// Set output bits off
BitWrPortI(PBDR, &PBDRShadow, 0, LCD_EN); // port B
BitWrPortI(PDDR, &PDDRShadow, 0, LCD_RS);
BitWrPortI(PDDR, &PDDRShadow, 0, LCD_RW);
// Make sure PD0-PD4 not set to alternate function
// BitWrPortI(PBFR, &PBFRShadow, 0, 1); // no FR for port B
BitWrPortI(PDFR, &PDFRShadow, 0, 0);
BitWrPortI(PDFR, &PDFRShadow, 0, 1);
BitWrPortI(PDFR, &PDFRShadow, 0, 2);
BitWrPortI(PDFR, &PDFRShadow, 0, 3);
costate // this task updates the LCD panel every 1 second
{
// initialize the LCD panel
wfd LcdWrite(Cmd, 0x30); // Send reset
waitfor(DelayMs(5));
wfd LcdWrite(Cmd, 0x30); // Send reset
wfd LcdWrite(Cmd, 0x30); // Send reset
wfd LcdWrite(Cmd, 0x38); // Send cmd 8bit, 2 lines, 5x7 font
wfd LcdWrite(Cmd, 0x08); // Turn display off
wfd LcdWrite(Cmd, 0x0C); // Turn display on
wfd LcdWrite(Cmd, 0x06); // Set Entry mode, increment move
wfd LcdWrite(Cmd, 0x10); // Display and cursor shift
wfd LcdWrite(Cmd, 0x0E); // Switch display and cursor on
wfd LcdWrite(Cmd, 0x01); // Clear the LCD and jump to zero
wfd LcdWrite(Cmd, 0x03); // Jump cursor to zero and clear any shift