2010年4月13日 星期二

[pic18net] string-buffer 宣告, 大有文章..

"固定字串"作宣告時 (ex, BYTE RdyPrompt[]="Program ready now.";); 會耗用哪一區/哪一部份(ex, Program/Data memory)的記憶體.. 在pic 系列中確實大有文章, 值得細細規劃/注意!!


1.
(Global declaration..)

2.
(Inner function declaration..)

3.
("ROM" decoration added..)

2010年4月3日 星期六

[pic18net] uart-communication by ISR

UART-Process by ISR

(1) taking advance of [Maestro] application module, Application Maestro
for PIC18 series
.
I'd been trying that UART2TCPBridge sample for reference of my apps, but fail..~_~


(2) make sure that pic18 system-clock rate
2a. PIC18net.2 board based

2b. In the "HardwareProfile.h", we found that..
(line156)

..
#ifdefine (PICDEMNET2) ||..
#define GetSystemClock() (41666667ul) //HZ
..

The system clock is "41.67MHZ".

2c. Maestro utility for USART interrupt by C, instead of Assembly

By default installation, the installed folder is "C:\Program Files\Microchip\MpAM".


2d. baudrate: 19200 bps


2e. have the 3 files putting into "the whole project"..
(1) UARTIntC.c
(2) UARTIntC.h
(3) UARTIntC.def


2f. In the main function of initialized state
call this function, "UARTIntInit()" calling.


2g. using the below pressure-testing code for Receiving and Sending..

...
//pressure testing for UART-communication by -----.---, 2010/04/03
if(!vUARTIntStatus.UARTIntRxBufferEmpty)
{
UARTIntGetChar(&chData);
if(!vUARTIntStatus.UARTIntTxBufferFull)
UARTIntPutChar(chData);
}//end of UART RCV-buffer not EMPTY
...


(3) pressure-testing, (N/G).. how come?!