I seem to be getting alot of resets in MACGetHeader, has anyone else seen this or have any ideas?
Code:
// such as if a single SPI bit error occurs while communicating or a
// momentary power glitch could cause this to occur in rare circumstances.
if(header.NextPacketPointer > RXSTOP || ((BYTE_VAL*)(&header.NextPacketPointer))->bits.b0 ||
header.StatusVector.bits.Zero ||
header.StatusVector.bits.CRCError ||
header.StatusVector.bits.ByteCount > 1518 ||
!header.StatusVector.bits.ReceiveOk)
{
//Reset();
printf("RESET CPU\r\n");
reset_cpu();
}
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Mar 15, 2010 12:19 pm
Add a printf statement (or statements) to display all those values in
the if() statement. Then you can see which one is causing the problem.
chrispol
Joined: 18 Oct 2009 Posts: 14
Posted: Tue Mar 16, 2010 11:58 am
Good idea will do
Thanks
chrispol
Joined: 18 Oct 2009 Posts: 14
Posted: Tue Mar 16, 2010 12:10 pm
Code:
Last Reset = 12
header.StatusVector.bits.CRCError
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
((BYTE_VAL*)(&header.NextPacketPointer))->bits.b0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
header.StatusVector.bits.ByteCount > 1518
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
Last Reset = 0
!header.StatusVector.bits.ReceiveOk
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum