michael coury

Software SPI Assembly

Discussion created by michael coury on Sep 12, 2006
Latest reply on Sep 12, 2006 by CompilerGuru
I pulled this code straight from a Freescale app note AN991.pdf Page 12... modified slightly...

asm{
LDA #$08
STA iBitCounter // Set bit counter
AGN:
BRSET 7,PORTA,* // Wait for Falling Edge of Clock Pin 7 of Port A
//ROL RES1 // Shift data to send
//BCS SET1 // Check data status
//BCLR 6,PORTC // If 0, clear data out
BRCLR 7,PTAD,* // Wait for Rising Edge of Clock Pin 7 of Port A
BSET 7,PTBD
BRSET 0,PTCD,STR // Check input data status
STR:
ROL *cSPIData_ptr // Store in result
DEC iBitCounter // Check for end of byte
BCLR 7,PTBD
BNE AGN
}


It doesn't compile in CW version 3.1 and I am assuming it has something to do with the '*'

First Error is C18103: Factor Expected highlighting the first line...

then

C18101: Object is not a field which again points to a line with a '*'



http://forums.freescale.com/freescale/board/post?board.id=8BITCOMM#
Submit Post
Thanks

Outcomes