need help with PIC programming

Thread Starter

alohaha

Joined May 2, 2007
2
i am new to the PIC programming, and i really has no idea how to program a SPI to communicate with the time to digital converter (TDC-GP2)from ACAM.The PIC i use is PIC16877A.

i really thanks that anyone can help me to finish the code below to the complete code? if it is too complicated, or too much... at least anyone can you kindly to drop some idea or comment for me ...please? if possible, can anyone help me to convert the code below to the assembly langauge?

i really has no idea at all now~~~ please....help me~~


the example code that ACAM company give i'll show below,



void gp2config()
{
SPIwrite8(0x50);
SPIwrite32(0x81194900);
SPIwrite32(0x81014100);
SPIwrite32(0x82E00000);
SPIwrite32(0x84200000);
SPIwrite32(0x82E00000);
}

voide measurement()
{
SPIwrite8(0x70);
check INTN=0?
SPIwrite32(0xb4);
SPIread8(STAT);
STAT&0x0600>0?
SPIwrite32(oxbo);
SPIread32(rego);
}
 
Top