so I decided to modify transmitting routine of boot loader:
void WriteCom(unsigned char dat)
{
#if RS485
UCSRBREG(COMPORTNo) = (1 << TXENBIT(COMPORTNo));
RS485Enable();
#endif
UDRREG(COMPORTNo) = dat;
//wait send finish
while(!(UCSRAREG(COMPORTNo) & (1<<TXCBIT(COMPORTNo))));
UCSRAREG(COMPORTNo) |= (1 << TXCBIT(COMPORTNo));
#if RS485
UCSRBREG(COMPORTNo) = (1 << RXENBIT(COMPORTNo));
RS485Disable();
#endif
#if WDG_En
//clear watchdog
wdt_reset();
#endif
}
--
You received this message because you are subscribed to the Google Groups "avrub" group.
To post to this group, send email to av...@googlegroups.com.
To unsubscribe from this group, send email to avrub+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/avrub?hl=en.