This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC2368 Libraries

Hello guys,

First of all, I am new on ARM7,

Are there any library for LPC2368, like something on ATMEGA32, (delay.h , LCD.h ) or...

For example for using PWMs, instead of using the registers directly, We use some of functions that is included in a library and in this way, We can use that functions instead of a lot of HEX numbers and name of registers.
It is really awful to program a micro using the machine language!

Sincerely yours,
Pooriya

Parents
  • Dears,

    I can't understand the BUNDLE codes, Would you guys tell me if I am right or not on below:

    for example on below code to set the cycle of PWM it is only enough to replace my desired cycle with cycle word on below codes?

    void PWM_Set( DWORD ChannelNum, DWORD cycle, DWORD offset )
    { if ( ChannelNum == 0 ) { PWM0MR0 = cycle; /* set PWM cycle */ PWM0MR1 = cycle * 5/6 + offset; PWM0MR2 = cycle * 2/3 + offset; PWM0MR3 = cycle * 1/2 + offset; PWM0MR4 = cycle * 1/3 + offset; PWM0MR5 = cycle * 1/6 + offset;

    /* The LER will be cleared when the Match 0 takes place, in order to load and execute the new value of match registers, all the PWMLERs need to reloaded. all PWM latch enabled */ PWM0LER = LER0_EN | LER1_EN | LER2_EN | LER3_EN | LER4_EN | LER5_EN | LER6_EN; } else if ( ChannelNum == 1 ) { PWM1MR0 = cycle; /* set PWM cycle */ PWM1MR1 = cycle * 5/6 + offset; PWM1MR2 = cycle * 2/3 + offset; PWM1MR3 = cycle * 1/2 + offset; PWM1MR4 = cycle * 1/3 + offset; PWM1MR5 = cycle * 1/6 + offset;

    /* The LER will be cleared when the Match 0 takes place, in order to load and execute the new value of match registers, all the PWMLERs need to reloaded. all PWM latch enabled */ PWM1LER = LER0_EN | LER1_EN | LER2_EN | LER3_EN | LER4_EN | LER5_EN | LER6_EN; } return;
    }

Reply
  • Dears,

    I can't understand the BUNDLE codes, Would you guys tell me if I am right or not on below:

    for example on below code to set the cycle of PWM it is only enough to replace my desired cycle with cycle word on below codes?

    void PWM_Set( DWORD ChannelNum, DWORD cycle, DWORD offset )
    { if ( ChannelNum == 0 ) { PWM0MR0 = cycle; /* set PWM cycle */ PWM0MR1 = cycle * 5/6 + offset; PWM0MR2 = cycle * 2/3 + offset; PWM0MR3 = cycle * 1/2 + offset; PWM0MR4 = cycle * 1/3 + offset; PWM0MR5 = cycle * 1/6 + offset;

    /* The LER will be cleared when the Match 0 takes place, in order to load and execute the new value of match registers, all the PWMLERs need to reloaded. all PWM latch enabled */ PWM0LER = LER0_EN | LER1_EN | LER2_EN | LER3_EN | LER4_EN | LER5_EN | LER6_EN; } else if ( ChannelNum == 1 ) { PWM1MR0 = cycle; /* set PWM cycle */ PWM1MR1 = cycle * 5/6 + offset; PWM1MR2 = cycle * 2/3 + offset; PWM1MR3 = cycle * 1/2 + offset; PWM1MR4 = cycle * 1/3 + offset; PWM1MR5 = cycle * 1/6 + offset;

    /* The LER will be cleared when the Match 0 takes place, in order to load and execute the new value of match registers, all the PWMLERs need to reloaded. all PWM latch enabled */ PWM1LER = LER0_EN | LER1_EN | LER2_EN | LER3_EN | LER4_EN | LER5_EN | LER6_EN; } return;
    }

Children
No data