Praveen1991
Newbie level 3
- Joined
- Jan 31, 2013
- Messages
- 3
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,283
- Location
- Trivandrum
- Activity points
- 1,306
Hi,
First of all, I am using PIC18F8722 for testing my program i wrote in ASSEMBLY for logging RAW data onto SDHC card ( 8GB Sandisk Class 4) using ( of Course ) SPI protocol. Been through every harrowing moment of not using C, and finally wrote the ASSEMBLY program to perfection ( of course with some help), and i simulated my program on PROTEUS and it worked like a charm, now when I burn the same program onto the PIC18DEM EXPLORER ( 18F8722) board, the processor loops in this part and never comes out,
SPI_IO movwf SSP1BUF
btfss SSP1CON1, WCOL
BRA S2
bcf SSP1CON1, WCOL
BRA SPI_IO
S2 btfss SSP1STAT, BF
BRA S2
movf SSP1BUF, w
return
It stays in this loop, like forever. But if the same board is burned with program written in C, it works just fine but not in assembly, Any idea where i would be going wrong, PLEASE HELP!!!!!!!
PS : This the first time i am using PIC series uC,
PPS : the Code is attached
PPPS : Even tried to implement the C libraries in Assembly but to no avail...
First of all, I am using PIC18F8722 for testing my program i wrote in ASSEMBLY for logging RAW data onto SDHC card ( 8GB Sandisk Class 4) using ( of Course ) SPI protocol. Been through every harrowing moment of not using C, and finally wrote the ASSEMBLY program to perfection ( of course with some help), and i simulated my program on PROTEUS and it worked like a charm, now when I burn the same program onto the PIC18DEM EXPLORER ( 18F8722) board, the processor loops in this part and never comes out,
SPI_IO movwf SSP1BUF
btfss SSP1CON1, WCOL
BRA S2
bcf SSP1CON1, WCOL
BRA SPI_IO
S2 btfss SSP1STAT, BF
BRA S2
movf SSP1BUF, w
return
It stays in this loop, like forever. But if the same board is burned with program written in C, it works just fine but not in assembly, Any idea where i would be going wrong, PLEASE HELP!!!!!!!
PS : This the first time i am using PIC series uC,
PPS : the Code is attached
PPPS : Even tried to implement the C libraries in Assembly but to no avail...