2006/6/8, Tom Sefranek : > No, after reading that there is NO peripheral support for the PIC24 series, > I switched my code for a pin identical dsPIC30F6011. > (Unfortunately it only has 6K of RAM.) > If I compile "my" UART2 write(), I get errors about all kinds of > undeclared stuff. > If you are interested, tomorrow, I can send my source code, it's pretty > small. > OK. Can you try this: Create a new write.c file, and put the following into it. Don't forget to add it to your project tree. #include #include #define SPEN 0x8000u #define TXEN 0x0400u #define TRMT 0x0100u #define TXBF 0x0200u #define RCDA 0x0001u int write(int handle, void *buffer, unsigned int len) { int i; switch (handle) { case 0: case 1: case 2: if ((U2MODE & SPEN) == 0) { U2BRG = 0; U2MODE |= SPEN; } if ((U2STA & TXEN) == 0) { U2STA |= TXEN; } for (i = len; i; --i) { while (U2STA & TXBF); U2TXREG = *(char*)buffer++; } break; default: break; } return(len); } Best regards, -- WH Tan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist