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
NXP has code_bundle for LPC23xx, but I don't think NXP provides library for LPC23xx. NXP has both code_bundle and library for LPC176x. NXP has code_bundle for LPC13xx, it seems NXP does not provides library for LPC13xx.
So, I think LPC1768 would be a better choice comparing to LPC2368.
Yes, I have looked to the NXP site, But found nothing, I am in the middle of a project and I can't change the project definition, So it would not be possible to use LPC1768,
Guys, I really need your help, programming a micro using its language is killing me!
Please HELP, HELP, HELP...
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; }
LPC23xx and LPC17xx have almost identical hardware functionality. The LPC17xx series is a tiny bit big brother, i.e. a number of peripherial hardware have some extra mode bits with some extensions relative to LPC23xx.
But the important thing is that it is useful to look at code that runs on the LPC17xx to get ideas for how to do things on a LPC23xx chip.
Another thing - a LPC1768 is pin compatible with a LPC2368 so even if far into a project it may still be possible to switch. LPC17xx is normally the processor family to select if starting new projects anyway.
So why are you doing a microcontroller project, then?!
Wasn't it obvious at the outset that a microcontroller project would require you to program the microcontroller?!
So what's the practical difference between a "code_bundle" and a "library" ?
mcb1700.code_.bundle.lpc17xx.keil_.zip:
It provides a lot of examples for each peripheral. Each example is independent.
The directory tree and content of the sample software =================== ADC BOD -- bod.h BOD header -- bod.c BOD APIs -- timer.h Timer header -- timer.c Timer APIs -- bodtest.c BOD controller test module -- bod.uvproj uVision 4 project file CAN CANACT DAC DMA EMAC EXTINT GPIO -- iotest.c GPIO and Fast I/O test module -- gpio.uvproj uVision 4 project file I2C -- i2c.h I2C header -- i2c.c I2C APIs -- i2cmst.c I2C test module -- i2c.uvproj uVision 4 project file I2CSLAVE -- i2cslave.h I2C slave header -- i2cslave0.c I2C0 slave APIs -- i2cslave1.c I2C1 slave APIs -- i2cslave2.c I2C2 slave APIs -- i2cslvtst.c I2C slave test module -- i2cslave.uvproj uVision 4 project file I2S USBAudio -- audio.h USB Audio related header -- adcuser.h USB Audio Device Class user specific header -- adcuser.c USB Audio Device Class user APIs -- usb.h USB header -- usbaudio.h USB Audio misc. definition header -- usbcfg.h USB configuration header -- usbcore.h USB Core header -- usbcore.c USB Core APIs -- usbdesc.h USB descriptor header -- usbdesc.c USB descriptor APIs -- usbhw.h USB hardware header -- usbhw.c USB hardware APIs -- usbreg.h USB misc. register header -- usbuser.h USB user header -- useuser.c USB user APIs -- usbmain.c USB Audio test module -- usbaudio.uvproj uVision 4 project file -- dma.sct uVision scatter file for use of DMA. WDT -- wdt.h Watchdog timer header -- wdt.c Watchdog timer APIs -- wdttest.c Watchdog timer test module -- wdt.uvproj uVision 4 project file
lpc175x_6x_cmsis_driver_library_0:
2014/01/17 09:17 <DIR> . 2014/01/17 09:17 <DIR> .. 2014/01/17 09:10 <DIR> Core 2014/01/17 09:10 <DIR> Drivers 2014/01/17 09:10 <DIR> Examples 2012/05/25 03:00 697 gdb_ram_init.jlink 2012/05/25 03:00 985 gdb_rom_init.jlink 2012/05/25 03:00 24,916,617 LPC1700 Peripheral Driver Library Manual.chm 2012/05/25 03:00 23,305 LPC1700CMSIS_ReleaseNotes.txt 2012/05/25 03:00 3,012 makefile 2014/01/17 09:10 <DIR> makesection 2012/05/25 03:00 73 setenv.bat
It provides drivers and examples.
\lpc175x_6x_cmsis_driver_library_0\lpc175x_6x_cmsis_driver_library\Drivers\source 2014/01/17 09:10 <DIR> . 2014/01/17 09:10 <DIR> .. 2012/05/25 03:00 10,321 debug_frmwrk.c 2012/05/25 03:00 11,627 lpc17xx_adc.c 2012/05/25 03:00 55,791 lpc17xx_can.c 2012/05/25 03:00 10,879 lpc17xx_clkpwr.c 2012/05/25 03:00 5,557 lpc17xx_dac.c 2012/05/25 03:00 31,830 lpc17xx_emac.c 2012/05/25 03:00 5,868 lpc17xx_exti.c 2012/05/25 03:00 17,592 lpc17xx_gpdma.c 2012/05/25 03:00 24,336 lpc17xx_gpio.c 2012/05/25 03:00 39,359 lpc17xx_i2c.c 2012/05/25 03:00 21,458 lpc17xx_i2s.c 2012/05/25 03:00 10,421 lpc17xx_iap.c 2012/05/25 03:00 2,815 lpc17xx_libcfg_default.c 2012/05/25 03:00 21,037 lpc17xx_mcpwm.c 2012/05/25 03:00 4,706 lpc17xx_nvic.c 2012/05/25 03:00 10,696 lpc17xx_pinsel.c 2012/05/25 03:00 19,966 lpc17xx_pwm.c 2012/05/25 03:00 21,230 lpc17xx_qei.c 2012/05/25 03:00 6,776 lpc17xx_rit.c 2012/05/25 03:00 24,646 lpc17xx_rtc.c 2012/05/25 03:00 14,126 lpc17xx_spi.c 2012/05/25 03:00 22,946 lpc17xx_ssp.c 2012/05/25 03:00 6,153 lpc17xx_systick.c 2012/05/25 03:00 20,238 lpc17xx_timer.c 2012/05/25 03:00 41,758 lpc17xx_uart.c 2012/05/25 03:00 8,323 lpc17xx_wdt.c 2012/05/25 03:00 2,787 makefile
"It provides a lot of examples for each peripheral"
And isn't that what the OP requires?
Those examples deal with REGISTERS directly.
The OP said: 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.
Thank you all, You really helped me with this matter,
And for answering Andrew I should say that, I am an AVR programmer, But I am doing my best to improve my ARM, It is not really necessary to be rude dear! By the way thanks for answering my questions.
Good luck.
This has nothing to do with ARM. The control registers on AVRs - or any other microcontroller - work in much the same way.
If you aren't able to work at the register level, then you really need to include that as one of your criteria for chip selection. As has already been noted, NXP do provide such libraries for their more recent chips. As do other manufacturers...