USE_TXENABLE 16F1783 timeout - Printable Version +- ds30 Loader free edition forums (https://picbootloader.com/forum) +-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3) +--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7) +--- Thread: USE_TXENABLE 16F1783 timeout (/showthread.php?tid=2311) |
USE_TXENABLE 16F1783 timeout - petspats - 2014-09-19 Hey! Thank you for the great software. It works great: Initiating write... Searching for bl . . . . . . . Found PIC16F1783 fw ver. 1.0.2 Waiting for the boot loader to be ready...ok Hex file successfully parsed Writing flash....ok Tx 387 bytes / Rx 14 bytes / 4,4s Write successfully completed However when i enable USE_TXENABLE it will just time out: Initiating write... Searching for bl . . Found PIC16F1783 fw ver. 1.0.2 Waiting for the boot loader to be ready...ok Hex file successfully parsed Writing flash....response timed out Write flash failed Tx 8 bytes / Rx 4 bytes / 30,9s Write failed So how could i fix this? Hoping for help. Peeter RE: USE_TXENABLE 16F1783 timeout - Mikael Gustavsson - 2014-09-19 Hi Peter, Why do you want to use a tx enable pin if it works without? RE: USE_TXENABLE 16F1783 timeout - petspats - 2014-09-19 Hey Mikael! I want to implement it for RS485. That is the reason. Thank you for fast answer! RE: USE_TXENABLE 16F1783 timeout - petspats - 2014-09-19 Hey again. I think i was misleading abit. I am using bootloader over UART to USB and it is working. Now since i plan to use it with UART to RS485 to USB i was testing out this tx enable pin. I am stil using UART to USB and i am just hoping to watch the tx enable pin on oscilloscope. But as you can see if i enable this option it will not get contact anymore. I hope it is clearer now Thanks! Peeter RE: USE_TXENABLE 16F1783 timeout - petspats - 2014-09-22 PHP Code: ;------------------------------------------------------------------------------ Hey! I got it working by commenting out enable/disable serial receiver lines. Why was it needed to enable/disable receiver? RE: USE_TXENABLE 16F1783 timeout - miklosch - 2014-09-22 Hello! I have a same problem with PIC18F26K22. I use RS485 line, and I can not write flash. Error is: Initiating write... Searching for bl . . . . . . Found PIC18F26K22 fw ver. 3.0.2 Waiting for the boot loader to be ready...ok Hex file successfully parsed Writing flash.... response timeout Writing flash... Write flash failed Tx 164 bytes / Rx 9 bytes / 3s Write failed Or: Initiating write... Searching for bl . Found PIC18F26K22 fw ver. 3.0.2 Waiting for the boot loader to be ready...ok Hex file successfully parsed Writing flash....unknown response 0xFF Writing flash... Write flash failed Tx 159 bytes / Rx 9 bytes / 0,5s Write failed But I can write the eeprom with same config: Initiating write... Searching for bl . . . . . . Found PIC18F26K22 fw ver. 3.0.2 Waiting for the boot loader to be ready...ok Hex file successfully parsed Writing eeprom...ok Tx 454 bytes / Rx 68 bytes / 3,8s Write successfully completed It work without RS485 perfectly: Initiating write... Searching for bl . Found PIC18F26K22 fw ver. 3.0.2 Waiting for the boot loader to be ready...ok Hex file successfully parsed Writing flash....ok Writing eeprom...ok Tx 3,9kB / Rx 160 bytes / 5,6s Write successfully completed RE: USE_TXENABLE 16F1783 timeout - petspats - 2014-09-23 Hey! Status update: I got it working with RS485. I belive the root problem is at uart.inc at function Send(). The last few statements are: ; Disable tx PHP Code: ifdef USE_TXENABLE Now with this I cannot write flash memory. I changed this to enable receiver as first instruction after send and now it is working: PHP Code: ifdef USE_TXENABLE Maybe there is problem, where PC program is answering too fast and RX is still disabled at that moment? RE: USE_TXENABLE 16F1783 timeout - miklosch - 2014-09-28 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 RE: USE_TXENABLE 16F1783 timeout - Mikael Gustavsson - 2014-10-05 Hi, Thank you petspats for the report. I was able to reproduce the problem and fix it with your path. The problem is that the RCSTA register may be located in a different memory bank than the tx enable pin port register. I will publish a new version of the ds30 Loader free edition package when I get time. miklosch: please start a separate thread. |