Electronic Circuits and Projects Forum



executing some asm before c init

« First 12
  1. Thread Starter #11
    kubeek kubeek is online now
    I know I can hack in there pullups, but this is not very nice on already produced boards.
    0

  2. #12
    3v0 3v0 is offline
    Coop Build Coordinator
    Quote Originally Posted by kubeek View Post
    I know I can hack in there pullups, but this is not very nice on already produced boards.
    Not nice but very common.
    0
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's PIC C18 Tutorials
    Mondo Tech's Super Probe
    Brian Schmalz's USB Bit Whacker

  3. #13
    misterT misterT is offline
    Quote Originally Posted by kubeek View Post
    Ok I found that the 0.5ms for the C init wasn´t the biggest problem, the default setting of 16K cycles + 65ms startup delay was much worse.
    Still, is there a way in avr-gcc to do what I intended?
    Yes:
    Code :
    #include <avr/io.h>
     
    void my_init_portb(void) __attribute__ ((naked)) __attribute__ ((section (".init0")));
     
    void my_init_portb(void)
    {
            PORTB = 0xff;
            DDRB = 0xff;
    }
    http://nongnu.org/avr-libc/user-manu..._sections.html
    The "naked" attribute strips off all the function entry and exit code. The section(".init0") defines the memory location where the piece of code is placed.
    +2
    Last edited by misterT; 12th April 2012 at 07:36 AM.
    "I cannot prove it because it is too basic. Every mathematician knows that the simplest things are the hardest to prove."

  4. Thread Starter #14
    kubeek kubeek is online now
    thanks that is exactly what i was looking for
    0

« First 12
Tags
Similar Threads
Thread Starter Forum Replies Last Post
need help modifying some pic ASM code justDIY Microcontrollers 18 27th September 2008, 02:04 PM
Can some one help me to edit this CLOCK ASM ? pasanlaksiri Microcontrollers 0 4th January 2008, 03:21 PM
what to look for in a multimeter before buying it. pkshima General Electronics Chat 17 24th February 2004, 02:46 AM
Need help grounding some exposed metal. RisingFire Electronic Projects Design/Ideas/Reviews 6 30th January 2003, 06:17 AM
Interresting project, need some help eliasbo Electronic Projects Design/Ideas/Reviews 2 5th January 2003, 10:42 PM
Electronic Circuits  |  Learning Electronics

Join our community with over 100,000 Members! It's free, easy and when you're logged in you have many more features! Click to register.
Page Time: 0.07412 seconds      Memory: 7,368 KB      Queries: 17      Templates: 0