New User - Problem with MicroBrn and example code

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
M0DJH
Posts: 4
Joined: Wed Sep 12, 2018 9:06 am

New User - Problem with MicroBrn and example code

Post by M0DJH » Tue Sep 25, 2018 4:34 pm

Hi,
I would really appreciate it if sdomeone can help me with this problem:

I was given a block of code to try out the USB port on an 18F4550 chip which I have pasted below. It compiles with no errors or warnings but when I try to load the hex file into microbrn it produces an error. The error says

Error in Hex File - Fuse
Line 4


This is the code:

Device = 18F4550
Clock = 48

// 20Mhz crystal, 48Mhz internal (FS USB)
Config
PLLDIV = 5,
CPUDIV = OSC1_PLL2,
USBDIV = 2,
FOSC = HSPLL_HS,
VREGEN = ON

// import modules...
include "usbcdc.bas"

// wait for connection...
repeat
until Attached

// main program loop - this just simply reads a byte from a
// terminal window (for example, SerialCommunicator) and then
// echos it back...

while true
if DataAvailable then
WriteByte(ReadByte)
endif
wend}


If anyone can try this or tell me what is wrong it would be greatly appreciated.

Thanks,

John

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: New User - Problem with MicroBrn and example code

Post by Jerry Messina » Tue Sep 25, 2018 5:05 pm

I've never used microbrn, but evidently it has a problem with config settings and you have to "fix" the hex file using fixhex2.exe. It also seems to have issues with eeprom data as well... doesn't seem to be a very good app (or maybe it's just ancient).

see http://www.embeddedforu.com/microcontro ... rogrammer/ for some hints.

Good luck!

M0DJH
Posts: 4
Joined: Wed Sep 12, 2018 9:06 am

Re: New User - Problem with MicroBrn and example code

Post by M0DJH » Wed Sep 26, 2018 7:14 am

OK, thanks for the post. This remedy uses MPLAB but I am using the swordfish IDE. Please can you suggest a programmer that I can use with the Swordfish IDE that can program using ICSP directly from the IDE that does not require 'fiddling' with the Hex file everytime.

Thanks,

John

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: New User - Problem with MicroBrn and example code

Post by David Barker » Wed Sep 26, 2018 7:38 am


Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: New User - Problem with MicroBrn and example code

Post by Jerry Messina » Wed Sep 26, 2018 11:04 am

You can also use the Microchip ICSP programmers like the PICkit3 http://www.microchip.com/Developmenttoo ... s/PG164130

MPLAB has a command-line tool to drive it (PK3CMD.exe) and that can be integrated into the Swordfish IDE.

Post Reply