??? 08/21/10 07:21 Read: times |
#178169 - Haven't seen full code - slave protocol state fully cleared? Responding to: ???'s previous message |
Note that:
((void(code*)(void))0x0000)();//Go to location 00 of code Does not reset the processor. The processor will not be in the same state when starting to run the startup code as it was after a reset, so the startup code and your init functions may fail because of the assumption that all processor state was in the reset state when the code is run. Another thing - you haven't shown us the full protocol-send code. The comment seems to indicate that a protocol message contains multiple bytes that each one requires an acknowledge - but what does the code look like? And will the protocol send code end if the board sees a new 9-bit address, addressing this or another board? If the slave doesn't clear all communication state when it - or another board - is addressed, it may try to continue with something else. The flag is ready to send is only valid to send a single byte immediately after being polled. And the protocol must be able to handle the situation that a slave polls the flag and sends a byte at the same time that a new address is being received - there must not be a lockup loop because the master things the answer it receives didn't match the start of a new transfer and then once more sends an address while the slave reacts to the previous addressing and once more sends an answer at the same time a new address is being received. |