Page 1 of 1

UMC Bootloader

Posted: Fri Feb 23, 2024 8:10 am
by richardb
Hi I thought i would start a fresh thread on this as it may be useful to others.

start with the basics as I have no idea what I'm doing and it may help others.

1.
I looked in the swordfish folder for the umcloader app, firstly is this the most up to date app or should I be looking for download?


2.
when I run UMCBuild.exe its unable to locate the mpasm path

I assume I need to download MPASA is there a particular version that I need to install? or do I just get the latest version?

3.

I'm looking to use the pic18f47q43 using intosc at 64MHz, On looking at the data sheet TX1 doesnt seem to have a default pin. would this be set with PPS in the bootloader?

Rich

Re: UMC Bootloader

Posted: Fri Feb 23, 2024 1:55 pm
by Jerry Messina
1 - The UMCLoader app in the MCLoader\umc folder is the latest version.

2 - You're not going to be able to use UMCBuild.exe to generate the bootloader for newer devices... it needs some microchip files that are no longer available. See UMC Build Error for more details.

What I've done for more recent chips (K22, K42) is to generate a standalone .asm file and assemble it using the mpasmx.exe that comes with SF.

3 - you need to add code to set up the pins and peripherals as required by your device... if it needs PPS then you have to add that code.

I could probably help with the Q43... let me take a look.

Re: UMC Bootloader

Posted: Sat Feb 24, 2024 3:20 pm
by Jerry Messina
I have a bootloader file put together for the Q43... now I just need to test it.

Won't be able to get to it till after the weekend

Re: UMC Bootloader

Posted: Mon Feb 26, 2024 7:52 am
by richardb
Thanks Gerry

Re: UMC Bootloader

Posted: Wed Feb 28, 2024 12:55 pm
by richardb
Any luck with this Gerry?

I really don't want to hassle you as you are generously offering your time, but i have a breadboard on my desk ready to try it before i finish a board design, and i'm unsure what the default pins are likely to be.


Rich

Re: UMC Bootloader

Posted: Wed Feb 28, 2024 1:43 pm
by Jerry Messina
Sorry Rich... real life got in the way. Hopefully I'll be able to get back to it today or tomorrow.

As far as the ports go, the default is to use the "standard"uart pins, but you can change this...

Code: Select all

;-----------------------------------------------------------------------------
; UART PORT/PIN selection
; modify this section to match your hardware configuration
; note that the Q43 PPS mapping only allows certain port selections:
; UART      2xQ43   4xQ43   5xQ43   
; UART1     B,C     B,C     C,F
; UART2     B,C     B,D     B,D
; UART3     A,B     A,B     A,F
; UART4 RX  B,C     B,D     B,D
; UART4 TX  A,B     A,D     A,D
; UART5 RX  A,C     A,C     A,F
; UART5 TX  B,C     B,C     C,F
; the following settings are for UART1 with PORTC RC6(TX out) and RC7(RX in) pins
;-----------------------------------------------------------------------------
#define UART_     1           ; UART select, 1-5
#define TX_PORT_  PORTC       ; TX output, PORTA-PORTF
#define TX_BIT_   6           ; TX output bit, 0-7
#define RX_PORT_  PORTC       ; RX input, PORTA-PORTF
#define RX_BIT_   7           ; RX input bit, 0-7

#if (UART_ == 0) || (UART_ > 5)
  error "UART_ selection error... 18FxxQ43 supports UART1-UART5"
#endif

Re: UMC Bootloader

Posted: Wed Feb 28, 2024 1:50 pm
by richardb
Thanks Gerry,

I was expecting the pins to use portc.6-7 but the datasheet was unclear on the tx1 pin it just said it was remappable.

anyway portc.6-7 are fine for me.


Thanks

Re: UMC Bootloader

Posted: Thu Feb 29, 2024 1:20 pm
by Jerry Messina
Here's a copy of the stand-alone UMC loader file for the Q43.

The umc_18FxxQ43.asm file contains info on how to assemble it to get the hex file... SF has all the files you need.
It should work with any of the Q43 family, allows use of UART1-UART5, and contains settings for PPS mapping to change the pins.

I pre-built a hex file (umc_18F27Q43_uart1.HEX) with the following default settings:
- 18F27Q43
- HFINTOSC at 64MHz
- UART1 mapped to PORTC RC6(TX out) and RC7(RX in) pins
- baudrate 115K (after initial startup at 19.2K)

Let me know if you have any issues with it.

Re: UMC Bootloader

Posted: Thu Feb 29, 2024 2:31 pm
by richardb
Thanks Gerry I'll have a look at this tomorrow

Re: UMC Bootloader

Posted: Fri Mar 01, 2024 1:26 pm
by richardb
Thanks Gerry that works really well, although.....


I spent much too long trying to diagnose a problem that didn't exist because I didn't realise i had to select the umc button on the mcloader
and i doesnt really show that its selected.


thanks again for your help on this i really appreciate it.


Richard

Re: UMC Bootloader

Posted: Fri Mar 01, 2024 1:38 pm
by Jerry Messina
Yeah, you have to have the 'UMC Firmware' button enabled in the MCLoader.

It shows as highlighted on my machine, but that probably depends on the OS, setup, etc, etc