Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

which assembler is to be used for generating tiny pic bootloader hex from its asm?

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
751
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,054
I have downloaded TinyPic bootloder from http://www.etc.ugal.ro/cchiculita/software/tinybld198.zip
It contain the exe file and the pic source files in asm,

Now I want to generate the hex file for PIC18F2455 at 8MHz.

But I don't know how to build this and when I tried to build it using MPLAB (windows) and GPASM (linux) it is showing many errors..


the asm file contains #include "../icdpictypes.inc" and #include "../spbgrselect.inc"
Also those files are there in the previous folder of the asm file...

How can I generate the hex file ?:roll:
 

I need to run some errands, when I return I'll take a look at the code and see if I can modify and assemble it for you.

I believe I have a few of the larger series of the PIC18F2455 family of PICs to test the bootloader.

BigDog
 
Sir,
thanks in advance..:)

Actually it is for PIC18F2458. But as u said earlier, it is almost similar to PIC18F2455.
 

Now I want to generate the hex file for PIC18F2455 at 8MHz.


Is that an 8MHz crystal or internal oscillator? What is the required system clock frequency? The device does have a PLL capable of generating up to a 48MHz system clock.


So configure the code for a PIC18F2458? I have a few PIC18F4553 of the same series in stock to test the resulting code.

BigDog
 
Attached are the zipped tiny PIC Bootloader project directory ported the PIC18F2458/2553/4458/4553 family.

The code now assembles without warnings or errors.

I've tested the bootloader using a PIC18F4553 and the test program, "bigstring18.asm."




The crystal frequency used was 4MHz, so you will need to change the CONFIG PLLDIV from 1 to 2, if you are using an 8MHz crystal.

Code:
CONFIG  PLLDIV = [COLOR="#FF0000"]2[/COLOR], CPUDIV = OSC3_PLL4, USBDIV = 2

Also you will note the Tiny Bootloader GUI App recognizes any of the PIC18F2458/2553/4458/4553 series as its PIC18F2455/2550/4455/4550 counterpart.

This is due to the lack of source for the the GUI App, which matches a code issued from the bootloader to a PIC device string which is outputted in window.

One issue to be aware of is once a program has been downloaded into the device, the bootloader waits for approximately 1 second, according to the code comments, before jumping and executing the program loaded in the flash. Which means you must click the "Write Flash" Button to download a new HEX file, immediately after resetting the device.

This is trickier that it sounds. You may want to change this "feature" to fit your requirements.

Code:
Receive
	movlw xtal/2000000+1	; for 20MHz => 11 => 1second delay
	movwf cnt1
rpt2						
	clrf cnt2
rpt3
	clrf cnt3
rptc
		btfss PIR1,RCIF			;test RX
		bra notrcv
	    movf RCREG,w			;return read data in W
	    addwf crc,f				;compute crc
		return
notrcv
	decfsz cnt3
	bra rptc
	decfsz cnt2
	bra rpt3
	decfsz cnt1
	bra rpt2
	;timeout:
way_to_exit
	bcf	RCSTA,	SPEN			; deactivate UART
	bra first_address

You might want to also consider writing your own bootloader, which frankly is not too difficult. Use this bootloader as a template and customize it to your liking.

BigDog
 

Attachments

  • vinodstanur.zip
    242.7 KB · Views: 70
Sir,
This is a great help .. Ones again I say thanks for spending some of your time for me..

Actually I didn't tried much on PIC asm. I like msp430 asm because I feel it much easier that the pic...

Now, I have a doubt if I can assemble it using "GPUTILS" in linux?
 

Actually I didn't tried much on PIC asm. I like msp430 asm because I feel it much easier that the pic...

PIC Assembly is not particularly complex. I would suggest studying a good PIC Assembly Tutorial, like the:

**broken link removed**

In some sense the PIC18F Assembly is less complicated than the Midrange PIC16F Assembly, due to the lack of bank/page concerns.

The PIC18F does have over double the number of instructions of the Midrange PIC16F series, however relatively speaking these numbers are still quite low.


Now, I have a doubt if I can assemble it using "GPUTILS" in linux?

The translation of Assembly Directives will most likely be the main issue. Directives like the CONFIG, cblock, etc, will need to be translated into their "GPUTILS" counterparts.

A fairly good text covering bootloaders is the following:

Embedded Systems Firmware Demystified

I would also take a look at Microchip's PIC18F series bootloader for insight.

BigDog
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top