Now on to the next problem..
I'm using the PIC24F curiosity board, and am trying to use the EPMP to drive a standard character LCD.
I've come across some 'C' code that shifts the LCD operation into a timed que process, freeing up the processor for other tasks while dealing with the slow LCD. It maps the LCD command/Data registers in the Extended Data space of the processor's RAM.
Here's the snippet that defines the port:
- Code: Select all
#define CS_BASE 0x2 UL //start address for LCD registers in EDS
/*
Address allocation for LCD registers
First line defines LCD command register, third line defines LCD data register and the second line is used to align data register to 16-bit word boundary.
This is done so that RS will clear while accessing LCDCMD and set while accessing LCDDATA – PIC24 is a 16-bit MCU and each memory address addresses 2-byte word.
*/
__eds__ uint8_t __attribute__((noload, section("epmp_cs1"), address(CS_BASE))) LCDCMD __attribute__((space(eds)));
__eds__ uint8_t __attribute__((noload, section("epmp_cs1"), address(CS_BASE))) LCDALIGN __attribute__((space(eds)));
__eds__ uint8_t __attribute__((noload, section("epmp_cs1"), address(CS_BASE))) LCDDATA __attribute__((space(eds)));
I need to convert this to Firewing. I'm guessing I'd do something like this:
- Code: Select all
public LCDDAT as uinteger absolute &H28000
public LCDCMD as uinteger absolute &H28001
I don't quite get what the middle line of code with the 'LCDALIGN' definition does; Rather, I understand what it does, just not how to implement it in Firewing.
When I send something to that address, I'd also assume I have set the DSWPAG for writes and the DSRPAG for reads.
Trying to make sense of it all..
Thanks much,
Jerry