Menu

AVR compatibility

cribcat
2019-01-24
2019-06-15
  • cribcat

    cribcat - 2019-01-24

    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.

     
  • Dan

    Dan - 2019-01-25

    Hi Clark

    Information is missing.

    Which AVR device do you use?

     
  • cribcat

    cribcat - 2019-01-26

    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

     
  • Dan

    Dan - 2019-01-27

    Hi Clark

    CLKPR Register exists in ATMEGA.

    Please use the CLKPR register.

     
    • cribcat

      cribcat - 2019-06-13

      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:

      LDI R16, low(RAMEND)
      OUT SPL, R16

      On Sat, Jan 26, 2019 at 5:04 PM Dan danx7@users.sourceforge.net wrote:

      Hi Clark

      CLKPR Register exists in ATMEGA.

      Please use the CLKPR register.

      Attachments:


      AVR compatibility
      https://sourceforge.net/p/tinypicbootload/discussion/help/thread/329c33f267/?limit=25#28c9


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/tinypicbootload/discussion/help/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Dan

    Dan - 2019-06-15

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.