1

I want to make a keyboard PCB with the PIC18F24K50. I could've sworn I saw a program that allows to program this microcontroller using only the USB and MCLR (reset) pins, but I can't find it anymore.
Is this possible? Or do I have to redesign the board and add breakout pads for the ICSP pins and buy a pickit or similar?
Or should I consider a more "beginner-friendly" microcontroller alltogether?

Edit: I ordered the PIC in a QFN28 package and soldered it on my board, however nothing happens when I plug it into my computer via USB. I was wondering if anything is supposed to happen and I screwed up the soldering?

  • In the general case, it is only possible if there's some bootloader hardware on-chip or similar pre-programmed bootloader firmware. As for your specific case, I have no idea. As for beginner-friendly... 8 bitters were never beginner-friendly if you intend to write in C. They are assembler beginner-friendly. – Lundin Nov 28 '22 at 14:00
  • Hrm I've decided to buy a pickit and redesign the board... not sure what you mean about 8-bit microcontrollers though, the atmega328p used in Arduinos is 8 bit and used in lots of hobby projects. – eigenwertnotfound Nov 28 '22 at 18:34
  • Something like this https://hackaday.io/project/63204-usb-c-usb-pic-bootloader – Antonio51 Nov 28 '22 at 19:10
  • Or this http://picpgm.picprojects.net/ – Antonio51 Nov 28 '22 at 19:27
  • @eigenwertnotfound Arduino isn't suitable for _any_ purpose, including teaching novices microcontroller programming. It's full of horrible practices like using C++ string classes and heap allocation. Regarding why 8-bitters are harder to program in C, here are some examples: https://electronics.stackexchange.com/a/594700/6102 – Lundin Nov 29 '22 at 09:19
  • > Something like this hackaday.io/project/63204-usb-c-usb-pic-bootloader OMG yes that is exactly the one, no idea why I wasn't able to find it anymore. Thank you @Antonio51 – eigenwertnotfound Nov 29 '22 at 17:18

1 Answers1

1

I was about to post this on the duplicate, but since it's a duplicate I'm posting the answer here instead. (In the future, don't ask a new question if you have new information--edit your original question instead.)

If your PIC doesn't have the bootloader loaded onto it, it doesn't know what to do with USB. You have to program it with the bootloader first.

So yes, you need to use some normal programming method, but once you have the bootloader on there you can just use the bootloader to program it over USB.

Hearth
  • 27,177
  • 3
  • 51
  • 115
  • I understand now thanks. I deleted the new question. – eigenwertnotfound Dec 09 '22 at 15:01
  • 1
    Moreover there's usually a GPIO wired to a button, used to trigger the boot loader to act as a mass storage device at powerup; if not pushed the boot loader loads the main application which may do something else with USB than a mass storage device. So, you need to wire the board correctly in addition to the one-time boot loader installation. – TypeIA Dec 09 '22 at 15:02
  • Yes I currently have MCLR pulled up to VDD with a button that pulls it down to ground as described by the datasheet in section 5.3. – eigenwertnotfound Dec 09 '22 at 15:10
  • @eigenwertnotfound You still need the bootloader programmed to actually do something in response to that input, not to mention to turn on the USB peripheral in the first place. – Hearth Dec 09 '22 at 15:30
  • I figured, I'm waiting for my pickit to arrive now. Thank you all for helping :) – eigenwertnotfound Dec 09 '22 at 17:07