View Full Version : PIC16F1454 Connecting To USB Doesn't Work
rsocor01
- 3rd December 2024, 01:44
Hi,
Has anybody tried to make a USB project with a PIC16F chip? I'm trying to make the PIC16F1454 work with USB, but I'm getting this error from PBP3 "USBIN/USBOUT/USBINIT/USBSERVICE commands not supported for this device." This chip has USB capabilities. This error makes me think that PBP3 doesn't support USB in PIC16F chips. Any advice or comments are greatly appreciated.
The error in red comes from me trying to include the usbjadem.bas descriptor.
I'm just trying to initialize the USB with usbinit and it is not working. My basic preliminary code below.
9849
#CONFIG
__config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_ON & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__config _CONFIG2, _WRT_OFF & _CPUDIV_NOCLKDIV & _PLLEN_ENABLED & _STVREN_OFF & _LPBOR_OFF & _LVP_OFF
#ENDCONFIG
TRISA = %00000000
ANSELA = %00000000
TRISC = %00000000
ANSELC = %00000000
usbinit
Demon
- 3rd December 2024, 19:29
https://www.microchip.com/maps/microcontroller.aspx
I entered:
Part family = PIC16F145x
USB interface = YES
Search results = No products meet selection bla bla bla
WTH...?
I was also planning on using this PIC for my project.
9850
Demon
- 3rd December 2024, 19:45
Ah crap.
If I search USB in PIC18F4550.PBPINC, I get this:
9851
If I do the same search in PIC16F1454.PBPINC:
9852
That messes up my plans as well for an inexpensive USB PIC. :mad:
Demon
- 3rd December 2024, 20:01
Holy crap, prices rise quickly.
DigiKey:
9853
rsocor01
- 3rd December 2024, 20:20
Demon, don't give up. This is a very inexpensive chip for a USB project. I was hoping to use it for a few projects I have. I don't think that they implemented the USB part for this chip in the PBP software. Maybe Melabs can help with this. What do you think?
rsocor01
- 3rd December 2024, 20:34
Also, PBP doesn't let you enable the PIC16F1454 USB internal voltage regulator. Below is the setting for the 18F4550.
9854
Demon
- 3rd December 2024, 20:37
Demon, don't give up. ...
Never give up, never surrender!
... I don't think that they implemented the USB part for this chip in the PBP software. Maybe Melabs can help with this. ...
Yeah, that much is obvious with that statement in the INCLUDE.
I don't have any "direct contact" at MeLabs, and all comments I've read say PBP is dead.
I can always ask, but I have a feeling this PIC or PBP is of little importance to them.
Demon
- 3rd December 2024, 20:41
Great, the only post I found over at MeLabs has a reply from Darrel explaining the 16F145x are mutant PICs. :biggrin:
https://support.melabs.com/forum/device-programmers/u2-usb-programmer/711-16f1455-support-on-older-usb-programmer#post2077
I'll ask and see what happens.
EDIT:
Done:
https://support.melabs.com/forum/picbasic-pro-compiler-3-0-and-later/pbp-wish-list/9415-usb-support-in-16f145x-series
rsocor01
- 3rd December 2024, 20:59
Great, the only post I found over at MeLabs has a reply from Darrel explaining the 16F145x are mutant PICs. [/url]
Darrel had a special talent to understand things when they were difficult and not obvious. I learned a lot from his posts.
I'll ask and see what happens.
[/url]
I will send Melabs an email. They always respond to my technical questions. I'll keep you posted.
rsocor01
- 4th December 2024, 03:22
Hmm, I'm trying to make this chip work with just an LED and the chip is not cooperating. I'm getting a "Does not match target device" error. When I try to get the target information, I get a different target id than the one in the INC file. If I change the INC file id to 3FFF, it doesn't work either.
I'm using the programming pins 9 and 10 to program the chip. The other 2 pins, 12 and 13, are for low voltage programming. They don't work either if I try them.
9855
9856
9857
Demon
- 4th December 2024, 04:14
Is there anything of value over there:
https://support.melabs.com/forum/device-programmers/u2-usb-programmer/711-16f1455-support-on-older-usb-programmer#post2077
Are you using the ZIF adapter?
(post #2)
Demon
- 4th December 2024, 04:17
And check out post 4 about the epic programmer files.
(I see you have EPC in you image.)
rsocor01
- 4th December 2024, 04:27
Hmm, I made it work for a flashing LED. This is weird, you need to power the 16F1454 chip with 5V. It won't get programmed if I power it with 3V. I have never seen this for a regular 16F chip.
Yes, that post from the forum was very helpful. He had some issues programming the chip too.
Demon
- 4th December 2024, 04:57
Like I said, mutant PICs.
😁
Ioannis
- 4th December 2024, 09:53
Why Microchip do such stupid things, like two sets of programming pins for low or high voltage?
Oh dear...
Ioannis
rsocor01
- 4th December 2024, 23:03
Why Microchip do such stupid things, like two sets of programming pins for low or high voltage?
Oh dear...
Ioannis
It doesn't make any sense to me either.
rsocor01
- 4th December 2024, 23:18
Bad news, I got this response from Melabs.
We tried many years ago, but failed to make the USB commands work in a useful way. In any case there is no further development planned for PBP.
The 18F25K50 is less expensive than the 18F4550, but not as cheap as the 16F1454.
I wonder if they are going to stop selling and supporting PBP after they said "there is no further development planned for PBP". We use their U2 programmers and software a lot. I responded to their email asking if they will keep supporting PBP.
rsocor01
- 4th December 2024, 23:22
The good news is that the 18F25K50 isn't that expensive. I'll order some and I'll give it a try.
9859
Demon
- 5th December 2024, 00:12
I just hit a sweet deal. At that price, I cleaned out everything they had on hand:
9860
These go for $3.91 / 100 at Digikey.
rsocor01
- 5th December 2024, 01:00
I just hit a sweet deal. At that price, I cleaned out everything they had on hand:
9860
These go for $3.91 / 100 at Digikey.
Those chips are the cheapest 18F with USB according to the Microchip Advanced Selector Chip tool. I'll order some and give it a try.
Ioannis
- 5th December 2024, 12:28
I wonder if they are going to stop selling and supporting PBP after they said "there is no further development planned for PBP". We use their U2 programmers and software a lot. I responded to their email asking if they will keep supporting PBP.
This is not new. For few years now the development of PBP has stopped. Only one man (Charles) supports any bugs found but no further work will be done. I guess he is or will be retired, so no interest by anyone to continue this great compiler.
It is pity that younger software engineers are not interested to take this compiler to the next level, but that is the case.
Ioannis
tumbleweed
- 5th December 2024, 20:11
I don't care much for the 18F1xK50, either of them. They don't have much ram/flash resources, plus...
Why Microchip do such stupid things, like two sets of programming pins for low or high voltage?
That was done for pin-out compatibility with the 18F1xK50, but these things are a royal PITA when it comes to programming them.
The ICSPCLK and ICSPDAT lines are shared with the USB D+/D- pins and that causes all sorts of issues:
- you have to make sure to unplug the USB cable when programming
- you can't program at 5V VDD since the USB D+/D- pins have a max voltage of 3.3V, and the programmers usually use VDD to power the programming pins
The programming spec shows the addtl circuitry required (they used to have a special adapter for this)
The second set of programming pins was added to the 16F part to help overcome this.
The 18F2xK50 is much easier to deal with.
See the PIC16(L)F145X Memory Programming Specification doc DS41620C (the 13/14K50 has similar restrictions)
Demon
- 5th December 2024, 21:20
Thanks for that heads up TW. I would have slapped those "sweet deals" on a breadboard and bricked a few before catching on.
😆
Demon
- 5th December 2024, 21:23
Those chips are the cheapest 18F with USB according to the Microchip Advanced Selector Chip tool. I'll order some and give it a try.
Don't bother at Arrow / Verical. I cleaned them out.
rsocor01
- 5th December 2024, 22:21
That was done for pin-out compatibility with the 18F1xK50, but these things are a royal PITA when it comes to programming
Yes, I agree with you. I had a hard time programming it just to flash an LED. Thank you for the explanation.
rsocor01
- 5th December 2024, 22:25
Don't bother at Arrow / Verical. I cleaned them out.
I bought a few from Mouser. I'm hoping I can make the USB part work without any issues. I'll open a new thread if I have problems.
Demon
- 6th December 2024, 03:48
I bought a few from Mouser. I'm hoping I can make the USB part work without any issues. I'll open a new thread if I have problems.
If not you, then most likely me. :D
Good for using Mouser, cause those on special at JLCPCB, it's the same units I bought. They just haven't updated their global stock yet.
9862
rsocor01
- 16th December 2024, 01:22
The 18F13K50 won't compile with the DT interrupt file ReEnterPBP-18.bas. This variable HP_Vars is in the DT ReEnter interrupt file. If you want to use this interrupt, you need to go with the 18F14K50. The 18F14K50 compiled fine, but I haven't test it because I don't have one now. I need to order it. All the USB commands compiled fine.
9872
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.