PDA

View Full Version : Tiny Bootloader 18F2420



ultiblade
- 20th June 2008, 14:11
Hi there,

I have been trying to get this to work for ages but without any result ...

I'm trying to use the tiny bootloader, i've searched on the forum, found some information
but was'nt able to use it ..

The problem: TinyBld keeps telling
"Connected to \\.\COM1 at 19200
Searching for PIC ...Not found,
ERROR!"

It's a 18F2420, i used the hex file included tinybld18F2420_int8MHz_19200.HEX
but that does'nt work. I'm sure the max232 works because when i use the code below
i receive "test" in a terminal program.

Does somebody have a working compiled hex for a 18F2420 with internal 8mhz osc lying around ?

Anyone ?



define OSC 8
OSCCON = %01111110

DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_SPBRG 51 ' 9600 Baud @ 8MHz, 0,16%
SPBRGH = 0
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator

ADCON0 = 0
ADCON1 = %00001111
TRISA = %00000000
TRISC = %11000000

START:
hserout ["test"]
pause 1000
goto start

progend:
goto progend


Best Regards,

UB

rinthesun
- 27th December 2009, 23:09
Did you ever get the tinyboot for 18F2420 working?

malc-c
- 28th December 2009, 11:36
Did you ever get the tinyboot for 18F2420 working?

The original post is over 18 months old... you might not get a response !

Melanie
- 28th December 2009, 11:45
This is what would worry me...

tinybld18F2420_int8MHz_19200.HEX

Are you trying to 'reliably' load a random PIC at 19200 Baud when running an INTERNAL 8MHz Oscillator? Only in your dreams!

ultiblade
- 28th December 2009, 20:09
Hi there,

Well i did get it to work, but by using a 16F88 ....
I could not get the tiny bl to work on the 2420, so i tried a different part to be sure it actually worked, it did work on a 16F88. Reducing the code and adding some extra analogue parts caused that i could stick to 16F88 and so i did ...

I still have a working 16F88 tiny bootloader hex + flash the led demo for pbp.

Let me know if you need i it ....

Best regards,
Ultiblade

rinthesun
- 29th December 2009, 05:22
Thanks for your reply. I do have the Tiny Bootloader reliable working with a 16F886 and hoped to get it working with the 18F family. Someone must have it working from the info on the Tiny Bootloader site. I will first try it with a 18F252 and if that works try the 18F2420. If I have any luck I will post it here.

ultiblade
- 29th December 2009, 20:33
Strange thing is that on the tiny website there is sample code called tinybld18F2420_int8MHz_19200.HEX and should work ...

The code sample never did work. Add the fact that Melanie is talking about "in your dreams", trying first on the 252 will be a good idea.

Succes !

Best regards,
UB

ScaleRobotics
- 30th December 2009, 21:50
You can also modify the TinyB18F.asm code for other PIC types. The cool part of using PIC18 device is that you can run the bootloader WITHOUT a MAX232! Just invert your USART with RXDTP and TXCKP. I have been meaning to try it since I read this thread: http://www.picbasic.co.uk/forum/showthread.php?t=10361

I finally tried it using a PIC18f2520 with a 22k resistor on the RX line, and with the addition of



BSF BAUDCON,RXDTP
BSF BAUDCON,TXCKP


to the sample .asm file they call TinyB18F.asm , which is included in the Tiny Bootloader download.

Nice to get rid of a $4.00 chip, and do it in hardware, well ... sort of software/hardware!

And it works!!

rinthesun
- 31st March 2010, 00:39
I have tiny working with the 18F252 and the 18F2420. I will upload the file in a day or so.

Dave
- 31st March 2010, 11:51
scalerobotics, WOW you pay $4.00 for an MAX-232.... You must be made of money...

Dave Purola,
N8NTA

ScaleRobotics
- 31st March 2010, 13:58
scalerobotics, WOW you pay $4.00 for an MAX-232.... You must be made of money...

No, mostly water really.

Thanks Dave, I guess I was using a Mercedes, when I could have used a Chevy.

A quick search of Digikey for MAX232 reveals the actual price of a Maxim MAX232 dip is $3.31 to $6.60 ( Unless you like the larger electrolytic caps). But, if you use an ST232C, instead of a MAX232, (after tax and a few capacitors), the cost is $1.25.

Either way, you will save some money and space on your board if you invert your coms and buy two resistors.

Dave
- 31st March 2010, 17:32
scalerobotics, There is just something wrong in my mind about connecting negative voltages to a unipolar input pin... I think the cost of a few transistors and a few resistors is worth the piece of mind....

Dave Purola,
N8NTA