View previous topic :: View next topic |
Author |
Message |
towlerg
Joined: 04 Dec 2011 Posts: 4
|
Newbee re #fuses and #device |
Posted: Fri Dec 14, 2018 8:20 am |
|
|
Very new to C although over the years I have tried and failed. Attempt 27 might be the charm.
I missed that you had to set ex_usb_common.h
If I change the header to 4550 and compile should the combo still show the original?
George
Last edited by towlerg on Fri Dec 14, 2018 9:18 am; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Fri Dec 14, 2018 8:36 am |
|
|
The examples are 'generic' in nature although some will have 2 or 3 device options at the beginning of the program....
fuses are PIC specific AND project related. Not all PICs have all fuses,so again can't be in the examples. YOUR project might require some configuration of fuses that MY project doesn't, so again...can't be in examples.
Typically 'my-first-PIC-program' should be the 1Hz LED program. That will prove that the PIC functions, HW is more or less OK and that you CAN program working code.
Since PICs can have more fuses than instructions, I now have an '#INCLUDE' file with a set of known ,working fuses. This 'baseline' file has ALL fuses in it, one per line WITH comments. It cleans up main() visually and I don't have to worry about my losuy typing anymore.
Jay |
|
|
towlerg
Joined: 04 Dec 2011 Posts: 4
|
|
Posted: Fri Dec 14, 2018 9:20 am |
|
|
@temtronic thanks for the info, total misunderstanding of how usb examples worked. see my revised post.
Kindda surprised I can still edit my post after someone has replied? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Fri Dec 14, 2018 9:49 am |
|
|
OK..I know the example does work with the 4550, as I used it years ago. I no longer use the 4550 (or any PIC with internal USB) as it is easier and cheaper to use a TTL<>USB module.
reasons include
1) cheaper. The TTL<>USB module only add $1 vs USB parts(connector,Rs,C, LED)
2) easy. Connect to any serial port of any PIC. I use the 18F46K22 for 99.99% of products
3) NO driver required. Saves a LOT of memory. About 1/3 of a 4550 IIRC.
When looking at 'cost', you need to consider PCB, parts AND your time. If you have to spend 3-4 days hacking the driver to make it work, chase down a : where a ; should be, or other minor glitch you've added to the cost of the project. USBTTL module is just $2 here in Canada, no muss, no fuss, they work. I do remove the power LED on them. They're way too BRIGHT and really not needed. Saves some power too !
just my thoughts....
jay |
|
|
dluu13
Joined: 28 Sep 2018 Posts: 395 Location: Toronto, ON
|
|
Posted: Fri Dec 14, 2018 2:19 pm |
|
|
I like to refer to the fuses.txt file that is in the PICC folder when you install your compiler. I cross reference that to the Configuration Bits section of the datasheet to figure out what I want to set. |
|
|
|