• AVR Freaks

Hot!Problem with Bootloader AN1310 and MCP2221

Author
PICnico
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2015/07/13 13:02:52
  • Location: 0
  • Status: offline
2019/04/20 05:14:05 (permalink)
0

Problem with Bootloader AN1310 and MCP2221

Hello,

I have a problem using the Bootloader described in AN1310 in combination with the MCP2221 chip as USB to UART converter on my board (using a PIC18F45K22). The problem is the re-entry into the Bootloader mode: If I am clicking the "Break/Reset Application Firmware" button or pressing F3 in the GUI the RX line won't asserted to low level.

Therefore I am not able to detect the break state in my ISR and can't release a soft reset in order to go to the Bootlader start up sequence Does anyone know why the MCP2221 doesn't pull the RX line low on clicking the button in the AN1310 GUI?

Since I assume that this is a MCP2221 internal problem that I can not resolve I was looking for a work around. That was my idea: If I receive the auto baud "request" from AN1310 GUI (the 0x0F) after the red "Bootloader Mode" button was clicked I can release the soft reset. With a little change of the AN1310 assembler code I could recognize that this was no real reset but a soft reset e.g. because a certain TRIS bit was already changed or something like that. Then I can skip the check if RX is low and directly go to the Booatloader mode section.

My problem atm is that I am not quite sure where I have to make this changes in the Bootloader code =/.
The Bootloader is per default located at the end of the memory.

Please let me know if you need some more details.

Best regards
Nico
#1

1 Reply Related Threads

    PICnico
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2015/07/13 13:02:52
    • Location: 0
    • Status: offline
    Re: Problem with Bootloader AN1310 and MCP2221 2019/04/20 05:33:17 (permalink)
    0
    Directly after I wrote my opening question I got the sulotion (so far I gues):
     
    I am clearing TRISA,0 in my code on boot up. Now I added the following code to the original <PIC18 Bootloader.asm> file (the label is not from my - only for orientation):
     
    BootloaderBreakCheck:
        banksel TRISA
        BTFSS TRISA,0 ; skip next cmd if TRISA7 is set (normal power up)
        bra BootloadMode

     
    Therefore I can skip the check for the BREAK state from GUI.
     
    This is working for me as a work around but nevertheless I would like to know why the MCP2221 doesn't pull the RX line to low.
     
    Best regards
    Nico
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5