I measured the communication with scop. I attached the pictures. Red is a TX line, and yellow is an RX line from PC.
EEPROM write working fine in both communication (RS232, RS485). FLASH writhe working only with RS232.
I think, in flash write mode answare the PIC too fast. TXE_DELAY number has no effect.
Attachment:
1: RS485 flash write
2: RS485 flash write enlarged
3: RS232 flash write
4: RS485 eeprom write
5: RS485 eeprom write enlarged
EEPROM write working fine in both communication (RS232, RS485). FLASH writhe working only with RS232.
I think, in flash write mode answare the PIC too fast. TXE_DELAY number has no effect.
Attachment:
1: RS485 flash write
2: RS485 flash write enlarged
3: RS232 flash write
4: RS485 eeprom write
5: RS485 eeprom write enlarged