Has anyone ever got the AVR side of this bootloader to work? I built the max 232 hardware and it works with serial comunications. The bootloader compiles, installs and locates itself in flash fine. The PC side of the software detects nothing even with RTS, DTR switched around. Am I using the wrong ports PORTD pins 0,1? RS232. Fusebits are set to 8MHz internal Osc. and clkdiv8 like the bootloader comments say... Any help would be great, Ironically I'll probably have it working soon.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the reply Dan,
The device is an AtMega328. It indeed does work on this device. I will probably use this on my tinys more than annything else. My issue was the !!!!! Set Fuse Bit CKDIV8=1 and 8MHz Calibration value !!!!! statement. So instead of CKDIV8 being unchecked in ponyProg2000, I checked the box so everything was div8. 1 == NOT SELECTED with avr fusebits. The point being is that you DO NOT want the CKDIV8 selected. I'm happy to say that the bootloader is small and I uploaded a blink routine successfully through the RS232 usart with no modifications.
Now to work on my PICs
Thanks,
Greg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have no idea if this is the right place for this info:
after looking at the source code it has come to my attention that no stack
is set up in any of the avr bootloader firmware that I can see. From my
understanding, on a call, the return address is pushed onto the stack and
then popped off automatically with the ret command. So something like this
is needed at the start of the program as the first action after .org
first_address+4. If you purposely omitted this then Please disregard this
message .
.org first_address+4
IntrareBootloader:
LDI R16, low(RAMEND)
OUT SPL, R16
LDI R16, high(RAMEND)
OUT SPH, R16
; -------- bootloader code here VV
SBI TXDDR,TX ; set TX Port
LDI rxd,Calib ; set 8MHz Calibration value
OUT OSCCAL,rxd
This insures that your call will return to calling routine upon the ret
statement. Otherwise the program will just reset or do weird stuff. If the
chip has less than 256 Bytes of Ram
you only need:
Has anyone ever got the AVR side of this bootloader to work? I built the max 232 hardware and it works with serial comunications. The bootloader compiles, installs and locates itself in flash fine. The PC side of the software detects nothing even with RTS, DTR switched around. Am I using the wrong ports PORTD pins 0,1? RS232. Fusebits are set to 8MHz internal Osc. and clkdiv8 like the bootloader comments say... Any help would be great, Ironically I'll probably have it working soon.
Hi Clark
Information is missing.
Which AVR device do you use?
Thanks for the reply Dan,
The device is an AtMega328. It indeed does work on this device. I will probably use this on my tinys more than annything else. My issue was the !!!!! Set Fuse Bit CKDIV8=1 and 8MHz Calibration value !!!!! statement. So instead of CKDIV8 being unchecked in ponyProg2000, I checked the box so everything was div8. 1 == NOT SELECTED with avr fusebits. The point being is that you DO NOT want the CKDIV8 selected. I'm happy to say that the bootloader is small and I uploaded a blink routine successfully through the RS232 usart with no modifications.
Now to work on my PICs
Thanks,
Greg
Hi Clark
CLKPR Register exists in ATMEGA.
Please use the CLKPR register.
I have no idea if this is the right place for this info:
after looking at the source code it has come to my attention that no stack
is set up in any of the avr bootloader firmware that I can see. From my
understanding, on a call, the return address is pushed onto the stack and
then popped off automatically with the ret command. So something like this
is needed at the start of the program as the first action after .org
first_address+4. If you purposely omitted this then Please disregard this
message .
IntrareBootloader:
LDI R16, low(RAMEND)
OUT SPL, R16
LDI R16, high(RAMEND)
OUT SPH, R16
; -------- bootloader code here VV
SBI TXDDR,TX ; set TX Port
LDI rxd,Calib ; set 8MHz Calibration value
OUT OSCCAL,rxd
This insures that your call will return to calling routine upon the ret
statement. Otherwise the program will just reset or do weird stuff. If the
chip has less than 256 Bytes of Ram
you only need:
LDI R16, low(RAMEND)
OUT SPL, R16
On Sat, Jan 26, 2019 at 5:04 PM Dan danx7@users.sourceforge.net wrote:
Hi Clark
It is not necessary to set the stack pointer.
At Reset, the ATMEGA automatically configures the stack at the end of the internal SRAM.
From Dan.