"Diolan Plus" bootloader.

A place to document your own projects.

Re: "Diolan Plus" bootloader.

Postby brdpic » Wed Jan 09, 2013 3:08 pm

please help me what should be changed to pic18f4550 (12MHz) "Diolan Plus" bootloader.?
brdpic
Newbie
Newbie
 
Posts: 7
Joined: Wed Jan 09, 2013 3:03 pm

Re: "Diolan Plus" bootloader.

Postby ian » Thu Jan 10, 2013 2:38 am

Just the crystal and oscillator fuse setting, depending on the crystal and multiplier combination you used.
User avatar
ian
Crew
Crew
 
Posts: 10578
Joined: Mon Jul 06, 2009 6:14 am

Re: "Diolan Plus" bootloader.

Postby brdpic » Thu Jan 10, 2013 11:05 am

Yes you are right.
That's just I can not understand, if before writing the *.hex program to "erase", all recorded fine if you do not - error. This is as it should be, or I made ​​a mistake somewhere?

ps
soft:
- fw_update.exe
- encoder.exe
brdpic
Newbie
Newbie
 
Posts: 7
Joined: Wed Jan 09, 2013 3:03 pm

Re: "Diolan Plus" bootloader.

Postby ian » Fri Jan 11, 2013 2:06 am

Yes, you must always erase the flash before programming, because it is only possible to flip the bits one direction (as I recall).
User avatar
ian
Crew
Crew
 
Posts: 10578
Joined: Mon Jul 06, 2009 6:14 am

Re: "Diolan Plus" bootloader.

Postby arhi » Fri Jan 11, 2013 2:09 am

ian wrote:Yes, you must always erase the flash before programming, because it is only possible to flip the bits one direction (as I recall).


you can flip them in both directions but the process is different hence usually you move a whole block in one direction (erase) and individual bits in another direction (write)
User avatar
arhi
Hero Member
Hero Member
 
Posts: 2109
Joined: Thu Jun 24, 2010 11:41 am
Location: Belgrade, Serbia

Re: "Diolan Plus" bootloader.

Postby brdpic » Fri Jan 11, 2013 5:31 am

Okay, I get it.

The new challenge, the bootloader only works if XINST = 1, and the main program only if XINST = 0. How can this be solved?
brdpic
Newbie
Newbie
 
Posts: 7
Joined: Wed Jan 09, 2013 3:03 pm

Re: "Diolan Plus" bootloader.

Postby arhi » Fri Jan 11, 2013 10:57 am

brdpic wrote:Okay, I get it.

The new challenge, the bootloader only works if XINST = 1, and the main program only if XINST = 0. How can this be solved?

You make your program with XINST=1 :)
User avatar
arhi
Hero Member
Hero Member
 
Posts: 2109
Joined: Thu Jun 24, 2010 11:41 am
Location: Belgrade, Serbia

Re: "Diolan Plus" bootloader.

Postby brdpic » Fri Jan 11, 2013 1:37 pm

brdpic wrote:Okay, I get it.

The new challenge, the bootloader only works if XINST = 1, and the main program only if XINST = 0. How can this be solved?


I was wrong, "Diolan Plus" bootloader work XINST = 0.

A possible Diolan original made to work with XINST = 0 or add encryption in "Diolan Plus"?
brdpic
Newbie
Newbie
 
Posts: 7
Joined: Wed Jan 09, 2013 3:03 pm

Re: "Diolan Plus" bootloader.

Postby ian » Mon Jan 14, 2013 3:25 am

I was wrong, "Diolan Plus" bootloader work XINST = 0.

A possible Diolan original made to work with XINST = 0 or add encryption in "Diolan Plus"?


I removed the XINST instructions, there is a 18F24J50 comment at each place, search the code and you should find the changes needed.
User avatar
ian
Crew
Crew
 
Posts: 10578
Joined: Mon Jul 06, 2009 6:14 am

Re: "Diolan Plus" bootloader.

Postby brdpic » Tue Jan 15, 2013 3:13 am

I can not understand why the read-only memory from the address 0x0800 to 0x5FFF.
Why don't read 0x5FFF...0x7FFF PIC18F4550?
brdpic
Newbie
Newbie
 
Posts: 7
Joined: Wed Jan 09, 2013 3:03 pm

Re: "Diolan Plus" bootloader.

Postby ian » Tue Jan 15, 2013 5:10 am

Not sure exactly what you mean, but without looking thr9ough the code my guess is that is the region where the main firmware is stored so it is blocked to the bootloader?
User avatar
ian
Crew
Crew
 
Posts: 10578
Joined: Mon Jul 06, 2009 6:14 am

Re: "Diolan Plus" bootloader.

Postby brdpic » Tue Jan 15, 2013 5:41 am

Code
Attachments
bootloader.zip
(180.04 KiB) Downloaded 203 times
brdpic
Newbie
Newbie
 
Posts: 7
Joined: Wed Jan 09, 2013 3:03 pm

Re: "Diolan Plus" bootloader.

Postby usa303 » Tue Sep 24, 2013 7:18 am

Trying to port this bootloader to pic18f45k50 that uses internal high-precision self tuning oscillator.

I changed fuse settings as below:
Code: Select all
CONFIG  PLLSEL = PLL3X       ; 3X PLL multiplier selected
CONFIG  CFGPLLEN = OFF       ; PLL turned on during execution
CONFIG  CPUDIV = NOCLKDIV    ; 1:1 mode (for 48MHz CPU)
CONFIG  LS48MHZ  = SYS48X8   ; Clock div / 8 in Low Speed USB mode
CONFIG  FOSC = INTOSCIO      ; HFINTOSC selected at powerup, no clock out

and added standard clock initialization procedure before bootloader starts (OSCTUNE, OSCCON, OSCCON2).

Bootloader starts, but PC writes that "USB device is not recognized".
Any idea what should be changed additionally to get it running?
usa303
Newbie
Newbie
 
Posts: 3
Joined: Tue Sep 24, 2013 7:09 am

Re: "Diolan Plus" bootloader.

Postby Sjaak » Tue Sep 24, 2013 9:07 am

Did you use (make) a new linkerscript? the USB stuff should be in a specific memory.
User avatar
Sjaak
Fellow
Fellow
 
Posts: 3039
Joined: Sun Jan 03, 2010 2:45 pm
Location: Hiero

Re: "Diolan Plus" bootloader.

Postby usa303 » Tue Sep 24, 2013 10:36 am

USB banks are the same for 4550 and 45k50 (400h-7FFh), so I simply used original linker script.
usa303
Newbie
Newbie
 
Posts: 3
Joined: Tue Sep 24, 2013 7:09 am

PreviousNext

Return to Project logs