Problem with Serial Communication
Posted: Mon Mar 05, 2012 2:51 pm
Hi, I am trying to receive data from my GPS and my data receiving part of code is as follows
But when I uploaded and ran the code I am getting the following error
Code: Select all
while(!charavail(UART0));
GPS[0]=sgetchar(UART0);
if(GPS[0]==0xAA){
Pins[21]=1;
while(!charavail(UART0));
GPS[1]=sgetchar(UART0);
while(!charavail(UART0));
GPS[2]=sgetchar(UART0);
if((GPS[1]==0x44)&& (GPS[2]==0x12)){
i=3;
while(charavail(UART0)&& i<100 ){
GPS[i]=sgetchar(UART0);
i++;
}
}
}
what am I doing incorrect? I would appreciate any help. Thanks in advance.
Waiting 5sec(s) to start 'A' to abort
Netburner MOD5213 Monitor V1.2 Dec 22 2009 13:14:17
Valid commands are
FLA (Flash load)
Setup
Boot
Version
Reset
NB>Download S record, X to abort
Go:BDB
Waiting 5sec(s) to start 'A' to abort
GPS_IMU_Data_Logger17
-------------------Trap information-----------------------------
Exception Frame/A7 =20002E04
Trap Vector =Access Error (2)
Format =03
Status register SR =2008
Fault Status =0C
Faulted PC =FFC04506
-------------------Register information-------------------------
A0=00000000 A1=2000040C A2=20002E3F A3=FFC04CDC
A4=FFC04C2C A5=FFC04EC4 A6=20002ED4 A7=20002E04
D0=00008033 D1=00000009 D2=00000044 D3=00000012
D4=00000044 D5=20002ED3 D6=20002EA0 D7=FFC09E14
SR=2008 PC=FFC04506
-------------------RTOS information-----------------------------
The OSTCBCur current task control block = 20001D38
This looks like a valid TCB
The current running task is: Main,#32
-------------------Task information-----------------------------
Task | State |Wait| Call Stack
Idle,#3F|Ready | |FFC06A24,0
Main,#32|Running | |FFC04506,FFC09908,0
-------------------End of Trap Diagnostics----------------------
Waiting 5sec(s) to start 'A' to abort
GPS_IMU_Data_Logger17
-------------------Trap information-----------------------------
Exception Frame/A7 =20002E04
Trap Vector =Access Error (2)
Format =03
Status register SR =2008
Fault Status =0C
Faulted PC =FFC04506
-------------------Register information-------------------------
A0=00000000 A1=2000040C A2=20002E3F A3=FFC04CDC
A4=FFC04C2C A5=FFC04EC4 A6=20002ED4 A7=20002E04
D0=00008034 D1=00000009 D2=00000044 D3=00000012
D4=00000044 D5=20002ED3 D6=20002EA0 D7=FFC09E14
SR=2008 PC=FFC04506
-------------------RTOS information-----------------------------
The OSTCBCur current task control block = 20001D38
This looks like a valid TCB
The current running task is: Main,#32
-------------------Task information-----------------------------
Task | State |Wait| Call Stack
Idle,#3F|Ready | |FFC06A24,0
Main,#32|Running | |FFC04506,FFC09908,0
-------------------End of Trap Diagnostics----------------------
Waiting 5sec(s) to start 'A' to abort
GPS_IMU_Data_Logger17
-------------------Trap information-----------------------------
Exception Frame/A7 =20002E04
Trap Vector =Access Error (2)
Format =03
Status register SR =2008
Fault Status =0C
Faulted PC =FFC04506
-------------------Register information-------------------------
A0=00000000 A1=2000040C A2=20002E3F A3=FFC04CDC
A4=FFC04C2C A5=FFC04EC4 A6=20002ED4 A7=20002E04
D0=00008035 D1=00000009 D2=00000044 D3=00000012
D4=00000044 D5=20002ED3 D6=20002EA0 D7=FFC09E14
SR=2008 PC=FFC04506
-------------------RTOS information-----------------------------
The OSTCBCur current task control block = 20001D38
This looks like a valid TCB
The current running task is: Main,#32
-------------------Task information-----------------------------
Task | State |Wait| Call Stack
Idle,#3F|Ready | |FFC06A24,0
Main,#32|Running | |FFC04506,FFC09908,0
-------------------End of Trap Diagnostics----------------------
Waiting 5sec(s) to start 'A' to abort