├── Microprocessor & Assembly language
├── Test Codes
│ ├── A2D
│ │ ├── ADC_Timer
│ │ │ ├── Objects
│ │ │ │ ├── glcd_lpc1700.d
│ │ │ │ ├── ExtDll.iex
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── adc_timer.crf
│ │ │ │ ├── glcd_lpc1700.crf
│ │ │ │ ├── gpio_lpc17xx.crf
│ │ │ │ ├── pin_lpc17xx.crf
│ │ │ │ ├── rtx_conf_cm.crf
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── joystick_mcb1700.crf
│ │ │ │ ├── ADC_Timer.build_log.htm
│ │ │ │ ├── rtx_conf_cm.d
│ │ │ │ ├── ADC_Timer_sct.Bak
│ │ │ │ ├── ADC_Timer.sct
│ │ │ │ ├── ADC_Timer.lnp
│ │ │ │ ├── adc_timer.d
│ │ │ │ ├── system_lpc17xx.d
│ │ │ │ ├── gpio_lpc17xx.d
│ │ │ │ ├── pin_lpc17xx.d
│ │ │ │ ├── joystick_mcb1700.d
│ │ │ │ └── spi_lpc17xx.d
│ │ │ ├── DebugConfig
│ │ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ ├── EventRecorderStub.scvd
│ │ │ ├── RTE
│ │ │ │ └── _Target_1
│ │ │ │ │ └── RTE_Components.h
│ │ │ └── ADC_Timer.c
│ │ ├── ADC_ShowonBar
│ │ │ ├── Flash
│ │ │ │ ├── irq.d
│ │ │ │ ├── ExtDll.iex
│ │ │ │ ├── bg_16bpp_b.d
│ │ │ │ ├── bg_16bpp_l.d
│ │ │ │ ├── bg_16bpp_r.d
│ │ │ │ ├── bg_16bpp_t.d
│ │ │ │ ├── arm_ani_16bpp.d
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── startup_lpc17xx_1.d
│ │ │ │ ├── core_cm3.d
│ │ │ │ ├── irq.o
│ │ │ │ ├── irq.crf
│ │ │ │ ├── Blinky.axf
│ │ │ │ ├── Blinky.plg
│ │ │ │ ├── blinky.crf
│ │ │ │ ├── blinky.o
│ │ │ │ ├── core_cm3.o
│ │ │ │ ├── bg_16bpp_b.o
│ │ │ │ ├── bg_16bpp_l.o
│ │ │ │ ├── bg_16bpp_r.o
│ │ │ │ ├── bg_16bpp_t.o
│ │ │ │ ├── core_cm3.crf
│ │ │ │ ├── arm_ani_16bpp.o
│ │ │ │ ├── bg_16bpp_b.crf
│ │ │ │ ├── bg_16bpp_l.crf
│ │ │ │ ├── bg_16bpp_r.crf
│ │ │ │ ├── bg_16bpp_t.crf
│ │ │ │ ├── glcd_lpc1700.o
│ │ │ │ ├── arm_ani_16bpp.crf
│ │ │ │ ├── glcd_lpc1700.crf
│ │ │ │ ├── startup_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── Blinky.build_log.htm
│ │ │ │ ├── startup_lpc17xx_1.o
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── system_lpc17xx_1.crf
│ │ │ │ ├── system_lpc17xx_1.o
│ │ │ │ ├── Blinky.sct
│ │ │ │ ├── Blinky.lnp
│ │ │ │ ├── system_lpc17xx.d
│ │ │ │ ├── system_lpc17xx_1.d
│ │ │ │ ├── glcd_lpc1700.d
│ │ │ │ └── blinky.d
│ │ │ ├── Blinky.Uv2.bak
│ │ │ ├── Blinky_Opt.Bak
│ │ │ ├── Blinky_Uv2.Bak
│ │ │ ├── GLCD_LPC1700.c
│ │ │ ├── DebugConfig
│ │ │ │ └── LPC1768_Flash_LPC1768.dbgconf
│ │ │ ├── RTE
│ │ │ │ └── RTE_Components.h
│ │ │ ├── JLinkSettings.ini
│ │ │ ├── JLink Regs CM3.txt
│ │ │ ├── Abstract.txt
│ │ │ └── IRQ.c
│ │ ├── ADC_Timer_Bar
│ │ │ ├── Objects
│ │ │ │ ├── ExtDll.iex
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── ADC_Timer.axf
│ │ │ │ ├── adc_timer.crf
│ │ │ │ ├── adc_timer.o
│ │ │ │ ├── pin_lpc17xx.o
│ │ │ │ ├── rtx_conf_cm.o
│ │ │ │ ├── glcd_lpc1700.o
│ │ │ │ ├── gpio_lpc17xx.o
│ │ │ │ ├── pin_lpc17xx.crf
│ │ │ │ ├── rtx_conf_cm.crf
│ │ │ │ ├── glcd_lpc1700.crf
│ │ │ │ ├── gpio_lpc17xx.crf
│ │ │ │ ├── joystick_mcb1700.o
│ │ │ │ ├── startup_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── joystick_mcb1700.crf
│ │ │ │ ├── ADC_Timer.build_log.htm
│ │ │ │ ├── rtx_conf_cm.d
│ │ │ │ ├── ADC_Timer.sct
│ │ │ │ ├── ADC_Timer.lnp
│ │ │ │ ├── system_lpc17xx.d
│ │ │ │ ├── glcd_lpc1700.d
│ │ │ │ ├── adc_timer.d
│ │ │ │ ├── gpio_lpc17xx.d
│ │ │ │ ├── pin_lpc17xx.d
│ │ │ │ ├── joystick_mcb1700.d
│ │ │ │ └── spi_lpc17xx.d
│ │ │ ├── GLCD_LPC1700.c
│ │ │ ├── DebugConfig
│ │ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ ├── RTE
│ │ │ │ └── RTE_Components.h
│ │ │ └── JLinkSettings.ini
│ │ ├── ADC1
│ │ │ ├── Objects
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── adc1.o
│ │ │ │ ├── ADC1.axf
│ │ │ │ ├── adc1.crf
│ │ │ │ ├── startup_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── ADC1.build_log.htm
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── ADC1.lnp
│ │ │ │ ├── ADC1_sct.Bak
│ │ │ │ ├── ADC1.sct
│ │ │ │ ├── adc1.d
│ │ │ │ └── system_lpc17xx.d
│ │ │ ├── DebugConfig
│ │ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ ├── EventRecorderStub.scvd
│ │ │ ├── RTE
│ │ │ │ └── _Target_1
│ │ │ │ │ └── RTE_Components.h
│ │ │ └── ADC1.c
│ │ ├── DAC0
│ │ │ ├── Objects
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── adc0.o
│ │ │ │ ├── DAC0.axf
│ │ │ │ ├── adc0.crf
│ │ │ │ ├── startup_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── DAC0.build_log.htm
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── DAC0.lnp
│ │ │ │ ├── DAC0_sct.Bak
│ │ │ │ ├── DAC0.sct
│ │ │ │ ├── adc0.d
│ │ │ │ └── system_lpc17xx.d
│ │ │ ├── DebugConfig
│ │ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ ├── EventRecorderStub.scvd
│ │ │ ├── RTE
│ │ │ │ └── _Target_1
│ │ │ │ │ └── RTE_Components.h
│ │ │ └── ADC0.c
│ │ ├── ADC_Add3Ch
│ │ │ ├── Objects
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── startup_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── adc_add3ch_outdac_timer.o
│ │ │ │ ├── ADC_Add3ch_outDAC_Timer.axf
│ │ │ │ ├── adc_add3ch_outdac_timer.crf
│ │ │ │ ├── ADC_Add3ch_outDAC_Timer.build_log.htm
│ │ │ │ ├── ADC_Add3ch_outDAC_Timer.lnp
│ │ │ │ ├── ADC_Add3ch_outDAC_Timer.sct
│ │ │ │ ├── system_lpc17xx.d
│ │ │ │ └── adc_add3ch_outdac_timer.d
│ │ │ ├── DebugConfig
│ │ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ └── RTE
│ │ │ │ └── RTE_Components.h
│ │ ├── ADC_DAC1
│ │ │ ├── Objects
│ │ │ │ ├── startup_lpc17xx.d
│ │ │ │ ├── adc_dac1.o
│ │ │ │ ├── ADC_DAC1.axf
│ │ │ │ ├── adc_dac1.crf
│ │ │ │ ├── startup_lpc17xx.o
│ │ │ │ ├── system_lpc17xx.crf
│ │ │ │ ├── system_lpc17xx.o
│ │ │ │ ├── ADC_DAC1.build_log.htm
│ │ │ │ ├── ADC_DAC1.lnp
│ │ │ │ ├── ADC_DAC1.sct
│ │ │ │ ├── adc_dac1.d
│ │ │ │ └── system_lpc17xx.d
│ │ │ ├── ADC_DAC1.c
│ │ │ ├── DebugConfig
│ │ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ └── RTE
│ │ │ │ └── RTE_Components.h
│ │ └── ADC_Add3ch_outDAC_Timer
│ │ │ ├── Objects
│ │ │ ├── startup_lpc17xx.d
│ │ │ ├── ADC_Timer.axf
│ │ │ ├── pin_lpc17xx.o
│ │ │ ├── rtx_conf_cm.o
│ │ │ ├── gpio_lpc17xx.o
│ │ │ ├── pin_lpc17xx.crf
│ │ │ ├── rtx_conf_cm.crf
│ │ │ ├── gpio_lpc17xx.crf
│ │ │ ├── joystick_mcb1700.o
│ │ │ ├── startup_lpc17xx.o
│ │ │ ├── system_lpc17xx.crf
│ │ │ ├── system_lpc17xx.o
│ │ │ ├── joystick_mcb1700.crf
│ │ │ ├── ADC_Timer.build_log.htm
│ │ │ ├── adc_add3ch_outdac_timer.o
│ │ │ ├── adc_add3ch_outdac_timer.crf
│ │ │ ├── rtx_conf_cm.d
│ │ │ ├── ADC_Timer.sct
│ │ │ ├── ADC_Timer.lnp
│ │ │ ├── system_lpc17xx.d
│ │ │ ├── adc_add3ch_outdac_timer.d
│ │ │ ├── gpio_lpc17xx.d
│ │ │ ├── pin_lpc17xx.d
│ │ │ └── joystick_mcb1700.d
│ │ │ ├── DebugConfig
│ │ │ └── Target_1_LPC1768.dbgconf
│ │ │ ├── RTE
│ │ │ └── RTE_Components.h
│ │ │ └── ADC_Add3ch_outDAC_Timer.c
│ ├── Timer
│ │ ├── Timer2_SquareWave
│ │ │ ├── README.md
│ │ │ └── main.c
│ │ ├── Timer0_SquareWave
│ │ │ └── Timer3_0.c
│ │ ├── Timer0_Ex2
│ │ │ └── Timer0_Ex2.c
│ │ ├── Timer0_Ex2_MAT2.3
│ │ │ └── Timer0_Ex2.c
│ │ ├── Timer0_Ex1
│ │ │ └── Timer0_Ex1.c
│ │ ├── Timer0_Ex1 - Copy
│ │ │ └── Timer0_Ex1.c
│ │ ├── Timer0_asCounter
│ │ │ └── Timer0AsCounter.c
│ │ ├── Timer0_Ex4
│ │ │ └── Timer0_Ex4.c
│ │ ├── Timer0_Ex3_0
│ │ │ └── Timer3_0.c
│ │ └── Timer0_Ex1_Timer2
│ │ │ └── Timer0_Ex1.c
│ ├── PWM
│ │ ├── PWM_Azmoon
│ │ │ └── alavi.c
│ │ ├── PWM_DC_ControlWithKey
│ │ │ └── PWM_DutyControlWithKey.c
│ │ ├── PWM_D_C10_100
│ │ │ └── PWM_DC_10_50.c
│ │ ├── PWM_DutyControlWithKey
│ │ │ └── PWM_DutyControlWithKey.c
│ │ ├── PWM_2Edge
│ │ │ └── PWM_2Edge.c
│ │ ├── PWM_2Edge_Azmon9803
│ │ │ └── PWM_2Edge_Azmoon9803.c
│ │ ├── PWM0
│ │ │ └── PWM_1Edge.c
│ │ └── PWM_INT
│ │ │ └── PWM_INT.c
│ └── Assembly
│ │ ├── Add regs
│ │ └── test00.s
│ │ ├── Use mla
│ │ └── test00.s
│ │ ├── Largest Element In An Array
│ │ └── test00.s
│ │ ├── Lsl and Asr
│ │ └── test00.s
│ │ └── Write a string in ram
│ │ └── test00.s
├── Assignment_02
│ ├── 1
│ │ └── main.c
│ ├── 2
│ │ └── main.c
│ ├── 3
│ │ └── main.c
│ ├── 4
│ │ └── main.c
│ ├── 5
│ │ └── main.c
│ ├── 6
│ │ └── main.c
│ ├── 7
│ │ └── main.c
│ ├── 8
│ │ └── main.c
│ ├── 9
│ │ └── main.c
│ ├── README.md
│ └── Micro_hw_Timer.pdf
├── Assignment_01
│ ├── 1
│ │ └── test00.s
│ ├── 2
│ │ └── test00.s
│ ├── 3
│ │ └── test00.s
│ ├── 4
│ │ └── test00.s
│ ├── 5
│ │ └── test00.s
│ └── Micro_001211_hw1.pdf
└── Assignment_03
│ ├── 1
│ └── main.c
│ ├── 2
│ └── main.c
│ ├── 3
│ └── main.c
│ └── Micro_hw_PWM_AD_DA.pdf
├── .gitattributes
├── lpc1768-arm.jpg
├── Microprocessor & Assembly language (Lab)
├── Displaying Scrolling (Moving) text on LCD
│ └── ADC_Timer_Bar
│ │ ├── Objects
│ │ ├── ExtDll.iex
│ │ ├── startup_lpc17xx.d
│ │ ├── adc_timer.o
│ │ ├── ADC_Timer.axf
│ │ ├── adc_timer.crf
│ │ ├── glcd_lpc1700.o
│ │ ├── gpio_lpc17xx.o
│ │ ├── pin_lpc17xx.crf
│ │ ├── pin_lpc17xx.o
│ │ ├── rtx_conf_cm.crf
│ │ ├── rtx_conf_cm.o
│ │ ├── glcd_lpc1700.crf
│ │ ├── gpio_lpc17xx.crf
│ │ ├── startup_lpc17xx.o
│ │ ├── system_lpc17xx.o
│ │ ├── joystick_mcb1700.crf
│ │ ├── joystick_mcb1700.o
│ │ ├── system_lpc17xx.crf
│ │ ├── ADC_Timer.build_log.htm
│ │ ├── ADC_Timer.lnp
│ │ ├── rtx_conf_cm.d
│ │ ├── ADC_Timer.sct
│ │ ├── system_lpc17xx.d
│ │ ├── glcd_lpc1700.d
│ │ ├── adc_timer.d
│ │ ├── gpio_lpc17xx.d
│ │ ├── pin_lpc17xx.d
│ │ ├── joystick_mcb1700.d
│ │ └── spi_lpc17xx.d
│ │ ├── GLCD_LPC1700.c
│ │ ├── DebugConfig
│ │ └── Target_1_LPC1768.dbgconf
│ │ ├── RTE
│ │ └── _Target_1
│ │ │ └── RTE_Components.h
│ │ └── JLinkSettings.ini
├── Displaying Scrolling (Moving) puls on LCD - Copy
│ └── ADC_Timer_Bar
│ │ ├── Objects
│ │ ├── ExtDll.iex
│ │ ├── startup_lpc17xx.d
│ │ ├── ADC_Timer.axf
│ │ ├── adc_timer.crf
│ │ ├── adc_timer.o
│ │ ├── pin_lpc17xx.o
│ │ ├── rtx_conf_cm.o
│ │ ├── glcd_lpc1700.o
│ │ ├── gpio_lpc17xx.o
│ │ ├── pin_lpc17xx.crf
│ │ ├── rtx_conf_cm.crf
│ │ ├── glcd_lpc1700.crf
│ │ ├── gpio_lpc17xx.crf
│ │ ├── joystick_mcb1700.o
│ │ ├── startup_lpc17xx.o
│ │ ├── system_lpc17xx.crf
│ │ ├── system_lpc17xx.o
│ │ ├── joystick_mcb1700.crf
│ │ ├── ADC_Timer.build_log.htm
│ │ ├── ADC_Timer.lnp
│ │ ├── rtx_conf_cm.d
│ │ ├── ADC_Timer.sct
│ │ ├── system_lpc17xx.d
│ │ ├── glcd_lpc1700.d
│ │ ├── adc_timer.d
│ │ ├── gpio_lpc17xx.d
│ │ ├── pin_lpc17xx.d
│ │ ├── joystick_mcb1700.d
│ │ └── spi_lpc17xx.d
│ │ ├── GLCD_LPC1700.c
│ │ ├── DebugConfig
│ │ └── Target_1_LPC1768.dbgconf
│ │ ├── RTE
│ │ └── _Target_1
│ │ │ └── RTE_Components.h
│ │ └── JLinkSettings.ini
├── Motor-Controller
│ ├── Objects
│ │ ├── startup_lpc17xx.d
│ │ ├── main.o
│ │ ├── main.crf
│ │ ├── project.axf
│ │ ├── system_lpc17xx.o
│ │ ├── startup_lpc17xx.o
│ │ ├── system_lpc17xx.crf
│ │ ├── project.build_log.htm
│ │ ├── project.lnp
│ │ ├── project.sct
│ │ ├── main.d
│ │ └── system_lpc17xx.d
│ ├── int.txt
│ ├── DebugConfig
│ │ └── Target_1_LPC1768.dbgconf
│ ├── EventRecorderStub.scvd
│ └── RTE
│ │ └── _Target_1
│ │ └── RTE_Components.h
├── EXINTs with priority
│ ├── README.md
│ ├── INT_Q.jpg
│ └── main.c
├── change led brightness with joystick (without PWM)
│ ├── README.md
│ └── Q.jpg
├── turn on led with timer
│ ├── README.md
│ ├── Q.jpg
│ ├── code.jpg
│ └── main.c
├── turn on led (alternatively)
│ └── Tamrin1.c
├── turn on led (alternatively) 2
│ └── exp_1.c
├── interrupt occuration counter
│ └── main.c
├── EXT interrupt vs GPIO interrupt (occur in same time ! )
│ └── main.c
└── turn on led with joystick
│ └── main.c
└── README.md
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/glcd_lpc1700.d:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Assignment_02
4 |
5 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/irq.d:
--------------------------------------------------------------------------------
1 | .\flash\irq.o: IRQ.c
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/ExtDll.iex:
--------------------------------------------------------------------------------
1 | [EXTDLL]
2 | Count=0
3 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/ExtDll.iex:
--------------------------------------------------------------------------------
1 | [EXTDLL]
2 | Count=0
3 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/ExtDll.iex:
--------------------------------------------------------------------------------
1 | [EXTDLL]
2 | Count=0
3 |
--------------------------------------------------------------------------------
/lpc1768-arm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shhb-Coder-1999/Microprocessor-and-Assembly-language/HEAD/lpc1768-arm.jpg
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/bg_16bpp_b.d:
--------------------------------------------------------------------------------
1 | .\flash\bg_16bpp_b.o: Bg_16bpp_b.c
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/bg_16bpp_l.d:
--------------------------------------------------------------------------------
1 | .\flash\bg_16bpp_l.o: Bg_16bpp_l.c
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/bg_16bpp_r.d:
--------------------------------------------------------------------------------
1 | .\flash\bg_16bpp_r.o: Bg_16bpp_r.c
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/bg_16bpp_t.d:
--------------------------------------------------------------------------------
1 | .\flash\bg_16bpp_t.o: Bg_16bpp_t.c
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/arm_ani_16bpp.d:
--------------------------------------------------------------------------------
1 | .\flash\arm_ani_16bpp.o: ARM_Ani_16bpp.c
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\flash\startup_lpc17xx.o: startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/ExtDll.iex:
--------------------------------------------------------------------------------
1 | [EXTDLL]
2 | Count=0
3 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/ExtDll.iex:
--------------------------------------------------------------------------------
1 | [EXTDLL]
2 | Count=0
3 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/Objects/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\startup_lpc17xx.o: RTE\Device\LPC1768\startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/Objects/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\startup_lpc17xx.o: RTE\Device\LPC1768\startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/Objects/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\startup_lpc17xx.o: RTE\Device\LPC1768\startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3Ch/Objects/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\startup_lpc17xx.o: RTE\Device\LPC1768\startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_DAC1/Objects/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\startup_lpc17xx.o: RTE\Device\LPC1768\startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/startup_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\startup_lpc17xx.o: RTE\Device\LPC1768\startup_LPC17xx.s
2 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/EXINTs with priority/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
3 |
4 |
3 | write a program to make a square wave with 25KHZ frequency (f_cpu = 80MHZ , f_pclk = 10MHZ)
4 |
3 |
4 |
5 | >>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/ADC_Timer.build_log.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Shhb-Coder-1999/Microprocessor-and-Assembly-language/HEAD/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/ADC_Timer.build_log.htm
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_DAC1/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3Ch/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/DebugConfig/LPC1768_Flash_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/turn on led (alternatively)/Tamrin1.c:
--------------------------------------------------------------------------------
1 | #include
2 | int x = 1;
3 |
4 |
5 | int main(){
6 | LPC_GPIO2->FIODIR=0xff;
7 | //set output led
8 |
9 | while(1){
10 | LPC_GPIO2->FIOPIN = x;
11 | x=x*2;
12 |
13 | if (x>128)x= 1;
14 | }
15 |
16 |
17 | while(1)
18 | {
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/DebugConfig/Target_1_LPC1768.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | // Debug Configuration
4 | // StopAfterBootloader Stop after Bootloader
5 | //
6 | Dbg_CR = 0x00000001;
7 |
8 |
9 |
10 | // <<< end of configuration section >>>
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/Objects/ADC1.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc1.o"
3 | ".\objects\startup_lpc17xx.o"
4 | ".\objects\system_lpc17xx.o"
5 | --strict --scatter ".\Objects\ADC1.sct"
6 | --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
7 | --info sizes --info totals --info unused --info veneers
8 | --list ".\Listings\ADC1.map" -o .\Objects\ADC1.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/Objects/DAC0.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc0.o"
3 | ".\objects\startup_lpc17xx.o"
4 | ".\objects\system_lpc17xx.o"
5 | --strict --scatter ".\Objects\DAC0.sct"
6 | --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
7 | --info sizes --info totals --info unused --info veneers
8 | --list ".\Listings\DAC0.map" -o .\Objects\DAC0.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_DAC1/Objects/ADC_DAC1.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_dac1.o"
3 | ".\objects\startup_lpc17xx.o"
4 | ".\objects\system_lpc17xx.o"
5 | --strict --scatter ".\Objects\ADC_DAC1.sct"
6 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
7 | --info sizes --info totals --info unused --info veneers
8 | --list ".\Listings\ADC_DAC1.map" -o .\Objects\ADC_DAC1.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/Objects/project.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\main.o"
3 | ".\objects\startup_lpc17xx.o"
4 | ".\objects\system_lpc17xx.o"
5 | --strict --scatter ".\Objects\project.sct"
6 | --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
7 | --info sizes --info totals --info unused --info veneers
8 | --list ".\Listings\project.map" -o .\Objects\project.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/EventRecorderStub.scvd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/EventRecorderStub.scvd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/EventRecorderStub.scvd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/EventRecorderStub.scvd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Assembly/Use mla/test00.s:
--------------------------------------------------------------------------------
1 | STACK_TOP EQU 0x20002000
2 |
3 | AREA RESET,CODE
4 | DCD STACK_TOP
5 | DCD start
6 | ENTRY
7 | start
8 | mov r0,#5
9 | mov r1,#7
10 | add r0,r0,r1
11 | subs r0,r0,r1
12 | ;stm r6!,(r5,r4,r9)
13 | mov r1,#5
14 | mov r2,#6
15 | mov r3,#7
16 | mov r4,#10
17 | mla r3,r1,r2,r4 ;r3 = r3 + (r1*r2)
18 |
19 | loop
20 | b loop
21 | end
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/rtx_conf_cm.d:
--------------------------------------------------------------------------------
1 | .\objects\rtx_conf_cm.o: RTE\CMSIS\RTX_Conf_CM.c
2 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\RTOS\RTX\INC\cmsis_os.h
3 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
4 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
5 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\RTOS\RTX\INC\RTX_CM_lib.h
6 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/rtx_conf_cm.d:
--------------------------------------------------------------------------------
1 | .\objects\rtx_conf_cm.o: RTE\CMSIS\RTX_Conf_CM.c
2 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\cmsis_os.h
3 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
4 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
5 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\RTX_CM_lib.h
6 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/rtx_conf_cm.d:
--------------------------------------------------------------------------------
1 | .\objects\rtx_conf_cm.o: RTE\CMSIS\RTX_Conf_CM.c
2 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\cmsis_os.h
3 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
4 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
5 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\RTX_CM_lib.h
6 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/ADC_Timer.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_timer.o"
3 | ".\objects\glcd_lpc1700.o"
4 | ".\objects\startup_lpc17xx.o"
5 | ".\objects\system_lpc17xx.o"
6 | --strict --scatter ".\Objects\ADC_Timer.sct"
7 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
8 | --info sizes --info totals --info unused --info veneers
9 | --list ".\Listings\ADC_Timer.map" -o .\Objects\ADC_Timer.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/rtx_conf_cm.d:
--------------------------------------------------------------------------------
1 | .\objects\rtx_conf_cm.o: RTE\CMSIS\RTX_Conf_CM.c
2 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\cmsis_os.h
3 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
4 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
5 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\RTX_CM_lib.h
6 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3Ch/Objects/ADC_Add3ch_outDAC_Timer.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_add3ch_outdac_timer.o"
3 | ".\objects\startup_lpc17xx.o"
4 | ".\objects\system_lpc17xx.o"
5 | --strict --scatter ".\Objects\ADC_Add3ch_outDAC_Timer.sct"
6 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
7 | --info sizes --info totals --info unused --info veneers
8 | --list ".\Listings\ADC_Add3ch_outDAC_Timer.map" -o .\Objects\ADC_Add3ch_outDAC_Timer.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/ADC_Timer.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_timer.o"
3 | ".\objects\glcd_lpc1700.o"
4 | ".\objects\startup_lpc17xx.o"
5 | ".\objects\system_lpc17xx.o"
6 | --strict --scatter ".\Objects\ADC_Timer.sct"
7 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
8 | --info sizes --info totals --info unused --info veneers
9 | --list ".\Listings\ADC_Timer.map" -o .\Objects\ADC_Timer.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/rtx_conf_cm.d:
--------------------------------------------------------------------------------
1 | .\objects\rtx_conf_cm.o: RTE\CMSIS\RTX_Conf_CM.c
2 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\cmsis_os.h
3 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
4 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
5 | .\objects\rtx_conf_cm.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC\RTX_CM_lib.h
6 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/RTE/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'Blinky'
7 | * Target: 'LPC1768 Flash'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 |
20 | #endif /* RTE_COMPONENTS_H */
21 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/turn on led (alternatively) 2/exp_1.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int x1 =1;
4 | int x2 = 128;
5 | int i;
6 |
7 | int main(){
8 | LPC_GPIO2->FIODIR = 0xff;
9 |
10 | while(1){
11 | int x3=x1|x2;
12 |
13 | LPC_GPIO2->FIOPIN =x3 ;
14 |
15 | for(i=0;i<2000000;i++){}
16 |
17 | if (x1==8 ){
18 | x1 = 1;
19 | }
20 | else {x1=x1*2;}
21 |
22 |
23 | if (x2==16 ){
24 | x2 = 128;
25 | }
26 | else {x2=x2/2;}
27 |
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/interrupt occuration counter/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | int i=0;
3 |
4 | int InitGPIO()
5 | {
6 | LPC_GPIO2->FIODIR0 = 0xff;
7 | LPC_GPIOINT->IO2IntEnF = ( 1 << 10 );
8 | NVIC_EnableIRQ(EINT3_IRQn);// ACTIVATION OF INTERRUPTION
9 | return 0;
10 |
11 | }
12 | void EINT3_IRQHandler(void){
13 | i++;
14 | LPC_GPIOINT->IO2IntClr = (1 << 10 );
15 | LPC_GPIO2->FIOPIN0=i;
16 |
17 | }
18 |
19 | int main()
20 | {
21 | InitGPIO();
22 | while(1)
23 | {
24 | }
25 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/JLinkSettings.ini:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ShowInfoWin = 1
3 | EnableFlashBP = 2
4 | BPDuringExecution = 0
5 | [CFI]
6 | CFISize = 0x00
7 | CFIAddr = 0x00
8 | [CPU]
9 | OverrideMemMap = 0
10 | AllowSimulation = 1
11 | ScriptFile=""
12 | [FLASH]
13 | SkipProgOnCRCMatch = 1
14 | VerifyDownload = 1
15 | AllowCaching = 1
16 | EnableFlashDL = 2
17 | Override = 0
18 | Device="ADUC7020X62"
19 | [GENERAL]
20 | WorkRAMSize = 0x00
21 | WorkRAMAddr = 0x00
22 | [SWO]
23 | SWOLogFile=""
24 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_DAC1/RTE/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC_DAC1'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/RTE/_Target_1/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'project'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3Ch/RTE/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC_Add3ch_outDAC_Timer'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/Objects/ADC1_sct.Bak:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/Objects/DAC0_sct.Bak:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/RTE/_Target_1/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC1'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | /* Keil::Device:Startup:1.0.0 */
20 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
21 |
22 |
23 | #endif /* RTE_COMPONENTS_H */
24 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_DAC1/Objects/ADC_DAC1.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/Blinky.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/RTE/_Target_1/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'DAC0'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | /* Keil::Device:Startup:1.0.0 */
20 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
21 |
22 |
23 | #endif /* RTE_COMPONENTS_H */
24 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/ADC_Timer_sct.Bak:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/ADC_Timer.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/RTE/_Target_1/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC_Timer'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/Objects/ADC1.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | .ANY (+XO)
11 | }
12 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
13 | .ANY (+RW +ZI)
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/Objects/DAC0.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | .ANY (+XO)
11 | }
12 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
13 | .ANY (+RW +ZI)
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3Ch/Objects/ADC_Add3ch_outDAC_Timer.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/ADC_Timer.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/RTE/_Target_1/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC_Timer'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/ADC_Timer.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | .ANY (+XO)
11 | }
12 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
13 | .ANY (+RW +ZI)
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/ADC_Timer.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/ADC_Timer.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/Blinky.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\flash\startup_lpc17xx.o"
3 | ".\flash\system_lpc17xx.o"
4 | ".\flash\core_cm3.o"
5 | ".\flash\blinky.o"
6 | ".\flash\irq.o"
7 | ".\flash\glcd_lpc1700.o"
8 | ".\flash\bg_16bpp_t.o"
9 | ".\flash\bg_16bpp_l.o"
10 | ".\flash\bg_16bpp_r.o"
11 | ".\flash\bg_16bpp_b.o"
12 | ".\flash\arm_ani_16bpp.o"
13 | --library_type=microlib --strict --scatter ".\Flash\Blinky.sct"
14 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
15 | --info sizes --info totals --info unused --info veneers
16 | --list ".\Flash\Blinky.map" -o .\Flash\Blinky.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/ADC_Timer.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_timer.o"
3 | ".\objects\joystick_mcb1700.o"
4 | "C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\RTOS\RTX\LIB\ARM\RTX_CM3.lib"
5 | ".\objects\rtx_conf_cm.o"
6 | ".\objects\gpio_lpc17xx.o"
7 | ".\objects\pin_lpc17xx.o"
8 | ".\objects\startup_lpc17xx.o"
9 | ".\objects\system_lpc17xx.o"
10 | --strict --scatter ".\Objects\ADC_Timer.sct"
11 | --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
12 | --info sizes --info totals --info unused --info veneers
13 | --list ".\Listings\ADC_Timer.map" -o .\Objects\ADC_Timer.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/ADC_Timer.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_add3ch_outdac_timer.o"
3 | ".\objects\joystick_mcb1700.o"
4 | "C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\LIB\ARM\RTX_CM3.lib"
5 | ".\objects\rtx_conf_cm.o"
6 | ".\objects\gpio_lpc17xx.o"
7 | ".\objects\pin_lpc17xx.o"
8 | ".\objects\startup_lpc17xx.o"
9 | ".\objects\system_lpc17xx.o"
10 | --strict --scatter ".\Objects\ADC_Timer.sct"
11 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
12 | --info sizes --info totals --info unused --info veneers
13 | --list ".\Listings\ADC_Timer.map" -o .\Objects\ADC_Timer.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/Objects/project.sct:
--------------------------------------------------------------------------------
1 | ; *************************************************************
2 | ; *** Scatter-Loading Description File generated by uVision ***
3 | ; *************************************************************
4 |
5 | LR_IROM1 0x00000000 0x00080000 { ; load region size_region
6 | ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
7 | *.o (RESET, +First)
8 | *(InRoot$$Sections)
9 | .ANY (+RO)
10 | }
11 | RW_IRAM1 0x10000000 0x00008000 { ; RW data
12 | .ANY (+RW +ZI)
13 | }
14 | RW_IRAM2 0x2007C000 0x00008000 {
15 | .ANY (+RW +ZI)
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/ADC_Timer.lnp:
--------------------------------------------------------------------------------
1 | --cpu Cortex-M3
2 | ".\objects\adc_timer.o"
3 | ".\objects\glcd_lpc1700.o"
4 | ".\objects\joystick_mcb1700.o"
5 | "C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\LIB\ARM\RTX_CM3.lib"
6 | ".\objects\rtx_conf_cm.o"
7 | ".\objects\gpio_lpc17xx.o"
8 | ".\objects\pin_lpc17xx.o"
9 | ".\objects\startup_lpc17xx.o"
10 | ".\objects\system_lpc17xx.o"
11 | --strict --scatter ".\Objects\ADC_Timer.sct"
12 | --summary_stderr --info summarysizes --map --xref --callgraph --symbols
13 | --info sizes --info totals --info unused --info veneers
14 | --list ".\Listings\ADC_Timer.map" -o .\Objects\ADC_Timer.axf
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/JLink Regs CM3.txt:
--------------------------------------------------------------------------------
1 | 0: R0: 0x00
2 | 1: R1: 0x01
3 | 2: R2: 0x02
4 | 3: R3: 0x03
5 | 4: R4: 0x04
6 | 5: R5: 0x05
7 | 6: R6: 0x06
8 | 7: R7: 0x07
9 | 8: R8: 0x08
10 | 9: R9: 0x09
11 | 10: R10: 0x0a
12 | 11: R11: 0x0b
13 | 12: R12: 0x0c
14 | 13: R13: 0x0d
15 | 14: R14: 0x0e
16 | 15: R15: 0x0f
17 | 16: XPSR: 0x10
18 | 17: MSP: 0x11
19 | 18: PSP: 0x12
20 | 19: RAZ: 0x13
21 | 20: CFBP: 0x14
22 | 21: APSR: 0x15
23 | 22: EPSR: 0x16
24 | 23: IPSR: 0x17
25 | 24: PRIMASK: 0x18
26 | 25: BASEPRI: 0x19
27 | 26: FAULTMASK: 0x1a
28 | 27: CONTROL: 0x1b
29 | 28: BASEPRI_MAX: 0x1c
30 | 29: IAPSR: 0x1d
31 | 30: EAPSR: 0x1e
32 | 31: IEPSR: 0x1f
33 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/RTE/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC_Timer'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_CMSIS_RTOS /* CMSIS-RTOS */
20 | #define RTE_CMSIS_RTOS_RTX /* CMSIS-RTOS Keil RTX */
21 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
22 |
23 | #endif /* RTE_COMPONENTS_H */
24 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_DAC1/Objects/adc_dac1.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_dac1.o: ADC_DAC1.c
2 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\adc_dac1.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_01/1/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 | AREA MYCODE , CODE , READONLY
5 |
6 | ENTRY
7 | Reset_Handler
8 | mov r0,#4
9 | ldr r1, =NumberInROM
10 | ldr r4, =0x10007FFF
11 | add r4,#0x10000000
12 | mov r5,#2
13 | sdiv r4,r4,r5
14 | subs r4,#2
15 | ldrb r3 , [r1]; read first data from flash
16 |
17 | TestNextByte
18 |
19 | ldrsb r3 , [r1];
20 | str r3,[r4]
21 | add r4,#1
22 | add r1,#1
23 | subs r0,#1
24 | bne TestNextByte
25 |
26 |
27 | loop
28 | b loop
29 |
30 | NumberInROM DCB 0x58 ,0x57 ,0x56 ,0x55
31 | AREA MYData , DATA , READWRITE
32 | COMMON NumberInRAM ,4 ,4
33 | end
34 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/RTE/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Component Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ADC_Add3ch_outDAC_Timer'
7 | * Target: 'Target 1'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "LPC17xx.h"
18 |
19 | #define RTE_CMSIS_RTOS /* CMSIS-RTOS */
20 | #define RTE_CMSIS_RTOS_RTX /* CMSIS-RTOS Keil RTX */
21 | #define RTE_DEVICE_STARTUP_LPC17XX /* Device Startup for NXP17XX */
22 |
23 | #endif /* RTE_COMPONENTS_H */
24 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/PWM/PWM_DC_ControlWithKey/PWM_DutyControlWithKey.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | #define t_1ms 25000
3 | char key;
4 | void PWM1_IRQHandler()
5 | {
6 | key=LPC_GPIO0->FIOPIN0&0x0f;
7 | if(key>10)key=10;
8 | LPC_PWM1->MR1 = (t_1ms * key) / 10;
9 | LPC_PWM1->LER = 0x2;
10 | LPC_PWM1->IR = 0x2;
11 | return;
12 | }
13 | void initPWM1()
14 | {
15 | LPC_PINCON->PINSEL4 |= 0x1;
16 | LPC_PWM1->MR0 = t_1ms;
17 | LPC_PWM1->MR1 = (t_1ms*10)/100;;
18 | LPC_PWM1->MCR = 0xA;
19 | LPC_PWM1->PCR = 0x200;
20 | LPC_PWM1->LER = 0x3;
21 | NVIC_EnableIRQ(PWM1_IRQn);
22 | LPC_PWM1->TCR = 0x9;
23 | }
24 | int main()
25 | {
26 | initPWM1();
27 | LPC_GPIO0->FIODIR0=0x00; // 8 bit 7-0 port0 as input
28 | while(1);
29 | }
30 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\flash\system_lpc17xx.o: system_LPC17xx.c
2 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.2.0\Device\Include\LPC17xx.h
4 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
5 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\flash\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.2.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Microprocessor-and-Assembly-language
2 |
3 |
4 |
5 |
6 |
MR1 = t_1ms * dutyCycles[counter++] / 100;
11 | if(counter == 8)
12 | counter = 0;
13 | LPC_PWM1->LER = 0x2;
14 | LPC_PWM1->IR = 0x2;
15 | return;
16 | }
17 |
18 | void initPWM1()
19 | {
20 | LPC_PINCON->PINSEL4 |= 0x1;
21 | LPC_PWM1->MR0 = t_1ms;
22 | LPC_PWM1->MR1 = (t_1ms*10)/100;;
23 | LPC_PWM1->MCR = (1<<1)|(1<<3);
24 | LPC_PWM1->PCR = (1<<9);
25 | LPC_PWM1->LER = 0x3;
26 | NVIC_EnableIRQ(PWM1_IRQn);
27 | LPC_PWM1->TCR = 0x9;
28 | }
29 |
30 | int main()
31 | {
32 | SystemInit();
33 | initPWM1();
34 | while(1);
35 | }
36 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/PWM/PWM_DutyControlWithKey/PWM_DutyControlWithKey.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | #define t_1ms 25000
4 |
5 | char dutyCycles[8] = {10, 20, 30, 40, 50, 40, 30, 20};
6 | char counter =1;
7 |
8 | void PWM1_IRQHandler()
9 | {
10 |
11 | LPC_PWM1->MR1 = (t_1ms * (LPC_GPIO0->FIOPIN0&0x0f)) / 10;
12 | LPC_PWM1->LER = 0x2;
13 | LPC_PWM1->IR = 0x2;
14 | return;
15 | }
16 |
17 | void initPWM1()
18 | {
19 | LPC_PINCON->PINSEL4 |= 0x1;
20 | LPC_PWM1->MR0 = t_1ms;
21 | LPC_PWM1->MR1 = (t_1ms*10)/100;;
22 | LPC_PWM1->MCR = 0xA;
23 | LPC_PWM1->PCR = 0x200;
24 | LPC_PWM1->LER = 0x3;
25 | NVIC_EnableIRQ(PWM1_IRQn);
26 | LPC_PWM1->TCR = 0x9;
27 | }
28 |
29 | int main()
30 |
31 | {
32 | initPWM1();
33 | LPC_GPIO0->FIODIR0=0x00; // 8 bit 7-0 port0 as input
34 | while(1);
35 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/turn on led with timer/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | #define MR0_Value 50000000
3 | #define PR0_Value 0
4 |
5 | void Init()
6 | {
7 | LPC_PINCON->PINSEL3 = (3<<12);
8 | LPC_TIM1->CTCR = 0;
9 | LPC_TIM1->PR = PR0_Value;
10 | LPC_TIM1->MR0 = MR0_Value;
11 | LPC_TIM1->MCR = 3;
12 | LPC_TIM1->EMR = (3<<4);
13 |
14 | NVIC_EnableIRQ(TIMER1_IRQn);
15 | LPC_TIM1->TCR = 1;
16 |
17 |
18 | }
19 | void TIMER1_IRQHandler(){
20 | LPC_TIM1->IR = 1;
21 | if(LPC_TIM1->MR0 == MR0_Value)
22 | {
23 | LPC_TIM1->MR0 = 25000000
24 | LPC_GPIO2->FIOPIN = 1;
25 |
26 | }
27 | else {
28 | LPC_TIM1->MR0 = MR0_Value;
29 | LPC_GPIO2->FIOPIN = 0;
30 |
31 | }
32 |
33 | }
34 |
35 | int main()
36 | {
37 | LPC_GPIO2->FIODIR |= 0xff;
38 | Init();
39 |
40 | while(1)
41 | {
42 | }
43 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/glcd_lpc1700.d:
--------------------------------------------------------------------------------
1 | .\flash\glcd_lpc1700.o: GLCD_LPC1700.c
2 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.2.0\Device\Include\lpc17xx.h
3 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\flash\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.2.0\Device\Include\system_LPC17xx.h
9 | .\flash\glcd_lpc1700.o: GLCD.h
10 | .\flash\glcd_lpc1700.o: Font_24x16.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_01/3/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 | ; mov r0,#8
10 |
11 | mov r0,#10-1
12 | ldr r1, =NumberInROM
13 | ldr r4, =NumberInRAM
14 | ;ldrsb r2 , [r1]; read first data from flash
15 | ldrsb r3 , [r1]; read first data from flash
16 |
17 | TestNextByte
18 | add r1,#1
19 | ldrsb r3 , [r1];
20 | str r3,[r4]
21 | add r4,#1
22 | cmp r2,r3
23 | bge NoExchange
24 | mov r2,r3
25 |
26 |
27 | NoExchange
28 | subs r0,#1
29 | bne TestNextByte
30 |
31 |
32 | loop
33 | b loop
34 |
35 | NumberInROM DCB -3,45,-45,111,176,29,23,-34,-78,0x25
36 | AREA MYData , DATA , READWRITE
37 | COMMON NumberInRAM ,12 ,4
38 | end
39 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/Objects/main.d:
--------------------------------------------------------------------------------
1 | .\objects\main.o: main.c
2 | .\objects\main.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.7.1\Device\Include\LPC17xx.h
3 | .\objects\main.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\core_cm3.h
4 | .\objects\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\main.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\cmsis_version.h
6 | .\objects\main.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\cmsis_compiler.h
7 | .\objects\main.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\cmsis_armcc.h
8 | .\objects\main.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\mpu_armv7.h
9 | .\objects\main.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.7.1\Device\Include\system_LPC17xx.h
10 | .\objects\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_SquareWave/Timer3_0.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 | // Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
3 | #define N_Value 1250 //Pclk=25MHz Time=50 uSec
4 | #define PR0_Value 0
5 | //*************************************************
6 | void init_timer0( ) // 10ms
7 | {
8 |
9 | LPC_PINCON->PINSEL3 |= ( 0x3<<24); // Set pin as Match Out 0 PIN1.28
10 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
11 | LPC_TIM0->MR0 = N_Value; //Timer Interval
12 | LPC_TIM0->MCR = 0x2; // NO Interrupt and Reset 0n MR0
13 | LPC_TIM0->EMR = 0x30; // Toggle MR0
14 | LPC_TIM0->TCR = 1;
15 | }
16 | //**************Main Function main()
17 | int main (void)
18 | {
19 | init_timer0();
20 | while (1)
21 | { /* Loop forever */
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_03/1/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | #define MR0_val 1375000 //5MHz * 275ms
3 | #define MR5_val (1375000*30)/100 // 30%
4 | #define MR6_val (1375000*45)/100 // 45%
5 |
6 | void initPWM1()
7 | {
8 | LPC_PINCON->PINSEL4 |= (1<<10); //PWM1.6;
9 | LPC_PWM1->MR0 = MR0_val;
10 | LPC_PWM1->MR5 = MR5_val;
11 | LPC_PWM1->MR6 = MR5_val + MR6_val;
12 | LPC_PWM1->MCR = 0x2; //Reset Counter When Match0 occured
13 | LPC_PWM1->PR = 4; // 25MHz/(4+1) = 5MHz
14 | LPC_PWM1->PCR = (1<<6)|(1<<14); // Select Two Edge & Enable PWM for PWM6
15 | LPC_PWM1->LER = 0x61; // Update Shadow Reg. MR0 & MR5 & MR6 - (0000-0000-0110-0001)
16 | //LPC_PWM1->LER = ( 0x3 << 5 ) | ( 1 << 0 ) ;
17 | LPC_PWM1->TCR = 0x9; //Counter & PWM Enable
18 | }
19 |
20 | int main()
21 | {
22 | initPWM1();
23 | while(1);
24 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/adc_timer.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_timer.o: ADC_Timer.c
2 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
4 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/glcd_lpc1700.d:
--------------------------------------------------------------------------------
1 | .\objects\glcd_lpc1700.o: GLCD_LPC1700.c
2 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\lpc17xx.h
3 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\glcd_lpc1700.o: GLCD.h
10 | .\objects\glcd_lpc1700.o: Font_24x16.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex2/Timer0_Ex2.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
4 | #define N_Value 1250
5 | #define PR0_Value 0
6 |
7 |
8 | //*************************************************
9 | void init_timer0( )
10 | {
11 | LPC_PINCON->PINSEL3 |= ( 0x3<<24); // Set pin as Match Out 0 PIN1.28
12 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
13 | LPC_TIM0->MR0 = N_Value; //Timer Interval
14 | LPC_TIM0->MCR = 2; //Reset on MR0 , No Interrupt
15 | LPC_TIM0->EMR = (0x3<<4); // Toggle MR0
16 | LPC_TIM0->TCR = 1; // enable_timer0
17 | }
18 | //**************Main Function main()
19 | int main (void)
20 | {
21 | init_timer0( ); // 50uSec
22 | while (1)
23 | { /* Loop forever */
24 | }
25 | }
26 | //*************** End Of File
27 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex2_MAT2.3/Timer0_Ex2.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
4 | #define N_Value 1250
5 | #define PR2_Value 24
6 |
7 |
8 | //*************************************************
9 | void init_timer2( )
10 | {
11 | LPC_PINCON->PINSEL0 |= ( 0x3<<18); // Set MAT2.3 as Output on PIN0.9
12 | LPC_TIM2->PR = PR2_Value; //set prescaler to zero
13 | LPC_TIM2->MR2 = N_Value; //Timer Interval
14 | LPC_TIM2->MCR = (2<<9); //Reset on MR3
15 | LPC_TIM2->EMR = (0x3<<10); // Toggle MR3
16 | LPC_TIM2->TCR = 1; // enable_timer0
17 | }
18 | //**************Main Function main()
19 | int main (void)
20 | {
21 | init_timer2( ); // 50uSec
22 | while (1)
23 | { /* Loop forever */
24 | }
25 | }
26 | //*************** End Of File
27 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Flash/blinky.d:
--------------------------------------------------------------------------------
1 | .\flash\blinky.o: Blinky.c
2 | .\flash\blinky.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.2.0\Device\Include\LPC17xx.H
3 | .\flash\blinky.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\flash\blinky.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\flash\blinky.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\flash\blinky.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\flash\blinky.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\flash\blinky.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.2.0\Device\Include\system_LPC17xx.h
9 | .\flash\blinky.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
10 | .\flash\blinky.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
11 | .\flash\blinky.o: GLCD.h
12 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Assembly/Largest Element In An Array/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 | ; mov r0,#8
10 |
11 | mov r0,#10-1
12 | ldr r1, =NumberInROM
13 | ldr r4, =NumberInRAM
14 | ldrsb r2 , [r1]; read first data from flash
15 | ldrb r3 , [r1]; read first data from flash
16 |
17 | TestNextByte
18 | add r1,#1
19 | ldrsb r3 , [r1];
20 | str r3,[r4]
21 | add r4,#4
22 | cmp r2,r3
23 | bge NoExchange
24 | mov r2,r3
25 |
26 | NoExchange
27 | subs r0,#1
28 | bne TestNextByte
29 |
30 |
31 | loop
32 | b loop
33 |
34 | NumberInROM DCB -3,45,-45,111,176,29,23,-34,-78,0x25
35 | AREA MYData , DATA , READWRITE
36 | COMMON NumberInRAM ,12 ,4
37 | end
38 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3Ch/Objects/adc_add3ch_outdac_timer.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_add3ch_outdac_timer.o: ADC_Add3ch_outDAC_Timer.c
2 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer2_SquareWave/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | #define N_Value 400
4 | #define PR0_Value 0
5 |
6 | void init_timer2()
7 | {
8 | LPC_PINCON->PINSEL0 |= (0x3<<16); //set pin as match out 2 pin0.8 - user manual page 117
9 | LPC_SC->PCLKSEL1 |= (0x3<<2); //set timer clk = 1/8 cpu clk - user manual page 58
10 | LPC_TIM2->PR = PR0_Value; //set prescaler to zero
11 | LPC_TIM2->MR2 = N_Value; //Timer interval -> 250,000
12 | LPC_TIM2->MCR = (0x2<<6); //010 No intrrupt (toggle) and reset on MR2 - user manual page 505
13 | LPC_TIM2->EMR = (3<<8); //toggle MR2 - user manual page 507
14 | LPC_TIM2->TCR = 1; //enable timer 2
15 | }
16 |
17 | int main(void)
18 | {
19 | init_timer2();
20 | while(1)
21 | {
22 | //loop for ever
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/7/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | int toggle =1;
3 |
4 | void EINT1_init ()
5 | {
6 | LPC_PINCON->PINSEL4 |= (0x01 << 22); // pin2.11 as EINT1 input - user manual page 119
7 | LPC_SC->EXTMODE|= (1<<1); // edge sensetive
8 | LPC_SC->EXTPOLAR|= ((1<<1)); // Rising
9 | //NVIC_SetPriority (EINT1_IRQn,1);
10 | NVIC_EnableIRQ(EINT1_IRQn);
11 | }
12 |
13 |
14 | void EINT1_IRQHandler(){
15 | if (toggle == 1){
16 | LPC_SC->EXTPOLAR = (~(1<<1));
17 | LPC_GPIO0->FIODIR2 = 0xFF;
18 | toggle = 0;
19 | }
20 | else{
21 | LPC_SC->EXTPOLAR = ((1<<1));
22 | LPC_GPIO0->FIODIR2 = 0x00;
23 | toggle = 1;
24 | }
25 |
26 | LPC_SC->EXTINT = (1<<1); //clr flag
27 | return;
28 | }
29 |
30 | int main()
31 | {
32 | EINT1_init();
33 |
34 | while(1)
35 | {
36 | }
37 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/adc_add3ch_outdac_timer.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_add3ch_outdac_timer.o: ADC_Add3ch_outDAC_Timer.c
2 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\adc_add3ch_outdac_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/glcd_lpc1700.d:
--------------------------------------------------------------------------------
1 | .\objects\glcd_lpc1700.o: GLCD_LPC1700.c
2 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\lpc17xx.h
3 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\glcd_lpc1700.o: GLCD.h
10 | .\objects\glcd_lpc1700.o: Font_24x16.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/glcd_lpc1700.d:
--------------------------------------------------------------------------------
1 | .\objects\glcd_lpc1700.o: GLCD_LPC1700.c
2 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\lpc17xx.h
3 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\glcd_lpc1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\glcd_lpc1700.o: GLCD.h
10 | .\objects\glcd_lpc1700.o: Font_24x16.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Motor-Controller/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.7.1\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\cmsis_version.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\cmsis_compiler.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\cmsis_armcc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\Include\mpu_armv7.h
9 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.7.1\Device\Include\system_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/adc_timer.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_timer.o: ADC_Timer.c
2 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
10 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
11 | .\objects\adc_timer.o: GLCD.h
12 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/gpio_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.c
2 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/system_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\system_lpc17xx.o: RTE\Device\LPC1768\system_LPC17xx.c
2 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
3 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
4 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
5 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\system_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/gpio_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.c
2 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/1/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | #define MR2_Value 200
4 | #define PR0_Value 0
5 |
6 | void init_timer2()
7 | {
8 | LPC_SC->PCONP = (1<<22); //Power on Timer2 - user manual page 64
9 | LPC_PINCON->PINSEL0 |= (0x3<<16); //set pin as match out 2 pin0.8 - user manual page 117
10 | LPC_SC->PCLKSEL1 |= (0x3<<12); //set timer clk = 1/8 cpu clk - user manual page 58
11 | LPC_TIM2->PR = PR0_Value; //set prescaler to zero
12 | LPC_TIM2->MR2 = MR2_Value; //Timer interval
13 | LPC_TIM2->MCR = (0x2<<6); //010 No intrrupt (toggle) and reset on MR2 - user manual page 505
14 | LPC_TIM2->EMR = (3<<8); //toggle MR2 - user manual page 507
15 | LPC_TIM2->TCR = 1; //enable timer 2
16 | }
17 |
18 | int main(void)
19 | {
20 | init_timer2();
21 | while(1)
22 | {
23 | //loop for ever
24 | }
25 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/adc_timer.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_timer.o: ADC_Timer.c
2 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
10 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
11 | .\objects\adc_timer.o: GLCD.h
12 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/adc_timer.d:
--------------------------------------------------------------------------------
1 | .\objects\adc_timer.o: ADC_Timer.c
2 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.H
3 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\adc_timer.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
10 | .\objects\adc_timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
11 | .\objects\adc_timer.o: GLCD.h
12 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/gpio_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.c
2 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Assembly/Lsl and Asr/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 | ; mov r0,#8
10 | mov r1,#-3
11 | lsl r1,#1
12 | mov r2,#-3
13 | lsr r2,#1
14 | mov r3,#-3
15 | asr r3,#1
16 |
17 |
18 |
19 | mov r0,#10-1
20 | ldr r1, =NumberInROM
21 | ldr r4, =NumberInRAM
22 | ldrsb r2 , [r1]; read first data from flash
23 | ldrb r3 , [r1]; read first data from flash
24 |
25 | TestNextByte
26 | add r1,#1
27 | ldrsb r3 , [r1];
28 | str r3,[r4]
29 | add r4,#4
30 | cmp r2,r3
31 | bge NoExchange
32 | mov r2,r3
33 |
34 | NoExchange
35 | subs r0,#1
36 | bne TestNextByte
37 |
38 |
39 | loop
40 | b loop
41 |
42 | NumberInROM DCB -3,45,-45,111,176,29,23,-34,-78,0x25
43 | AREA MYData , DATA , READWRITE
44 | COMMON NumberInRAM ,12 ,4
45 | end
46 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/gpio_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.c
2 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
10 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/JLinkSettings.ini:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ForceImpTypeAny = 0
3 | ShowInfoWin = 1
4 | EnableFlashBP = 2
5 | BPDuringExecution = 0
6 | [CFI]
7 | CFISize = 0x00
8 | CFIAddr = 0x00
9 | [CPU]
10 | MonModeVTableAddr = 0xFFFFFFFF
11 | MonModeDebug = 0
12 | MaxNumAPs = 0
13 | LowPowerHandlingMode = 0
14 | OverrideMemMap = 0
15 | AllowSimulation = 1
16 | ScriptFile=""
17 | [FLASH]
18 | CacheExcludeSize = 0x00
19 | CacheExcludeAddr = 0x00
20 | MinNumBytesFlashDL = 0
21 | SkipProgOnCRCMatch = 1
22 | VerifyDownload = 1
23 | AllowCaching = 1
24 | EnableFlashDL = 2
25 | Override = 0
26 | Device="ARM7"
27 | [GENERAL]
28 | WorkRAMSize = 0x00
29 | WorkRAMAddr = 0x00
30 | RAMUsageLimit = 0x00
31 | [SWO]
32 | SWOLogFile=""
33 | [MEM]
34 | RdOverrideOrMask = 0x00
35 | RdOverrideAndMask = 0xFFFFFFFF
36 | RdOverrideAddr = 0xFFFFFFFF
37 | WrOverrideOrMask = 0x00
38 | WrOverrideAndMask = 0xFFFFFFFF
39 | WrOverrideAddr = 0xFFFFFFFF
40 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Assembly/Write a string in ram/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 | ; mov r0,#8
10 |
11 | ldr r1, =MyNameInROM
12 | ldr r4, =MyNameInRAM
13 | ldr r5, =MyNameInRAM
14 |
15 | TestNextByte
16 | ldrsb r2 ,[r1] ; read first data from flash
17 | cmp r2,#0 ;if r2==0 goto loop . why 0 ? couse 0 in our condition to break loop
18 | beq loop
19 | add r1,#1 ;increment pointer
20 | strb r2,[r4] ;write data to ram
21 | strb r2,[r5] ;write data to ram
22 |
23 | add r4,#1 ;add RAM pointer with 1
24 | add r5,#1 ;add RAM pointer with 1
25 | b TestNextByte
26 |
27 | loop
28 | b loop
29 |
30 | MyNameInROM DCB "abbas laki",0
31 | AREA MYData , DATA , READWRITE
32 | COMMON MyNameInRAM ,12 ,4
33 | COMMON MyBookInRAM ,12 ,4
34 |
35 | end
36 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/pin_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.c
2 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/pin_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.c
2 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/JLinkSettings.ini:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ForceImpTypeAny = 0
3 | ShowInfoWin = 1
4 | EnableFlashBP = 2
5 | BPDuringExecution = 0
6 | [CFI]
7 | CFISize = 0x00
8 | CFIAddr = 0x00
9 | [CPU]
10 | MonModeVTableAddr = 0xFFFFFFFF
11 | MonModeDebug = 0
12 | MaxNumAPs = 0
13 | LowPowerHandlingMode = 0
14 | OverrideMemMap = 0
15 | AllowSimulation = 1
16 | ScriptFile=""
17 | [FLASH]
18 | CacheExcludeSize = 0x00
19 | CacheExcludeAddr = 0x00
20 | MinNumBytesFlashDL = 0
21 | SkipProgOnCRCMatch = 1
22 | VerifyDownload = 1
23 | AllowCaching = 1
24 | EnableFlashDL = 2
25 | Override = 0
26 | Device="ARM7"
27 | [GENERAL]
28 | WorkRAMSize = 0x00
29 | WorkRAMAddr = 0x00
30 | RAMUsageLimit = 0x00
31 | [SWO]
32 | SWOLogFile=""
33 | [MEM]
34 | RdOverrideOrMask = 0x00
35 | RdOverrideAndMask = 0xFFFFFFFF
36 | RdOverrideAddr = 0xFFFFFFFF
37 | WrOverrideOrMask = 0x00
38 | WrOverrideAndMask = 0xFFFFFFFF
39 | WrOverrideAddr = 0xFFFFFFFF
40 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/JLinkSettings.ini:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ForceImpTypeAny = 0
3 | ShowInfoWin = 1
4 | EnableFlashBP = 2
5 | BPDuringExecution = 0
6 | [CFI]
7 | CFISize = 0x00
8 | CFIAddr = 0x00
9 | [CPU]
10 | MonModeVTableAddr = 0xFFFFFFFF
11 | MonModeDebug = 0
12 | MaxNumAPs = 0
13 | LowPowerHandlingMode = 0
14 | OverrideMemMap = 0
15 | AllowSimulation = 1
16 | ScriptFile=""
17 | [FLASH]
18 | CacheExcludeSize = 0x00
19 | CacheExcludeAddr = 0x00
20 | MinNumBytesFlashDL = 0
21 | SkipProgOnCRCMatch = 1
22 | VerifyDownload = 1
23 | AllowCaching = 1
24 | EnableFlashDL = 2
25 | Override = 0
26 | Device="ARM7"
27 | [GENERAL]
28 | WorkRAMSize = 0x00
29 | WorkRAMAddr = 0x00
30 | RAMUsageLimit = 0x00
31 | [SWO]
32 | SWOLogFile=""
33 | [MEM]
34 | RdOverrideOrMask = 0x00
35 | RdOverrideAndMask = 0xFFFFFFFF
36 | RdOverrideAddr = 0xFFFFFFFF
37 | WrOverrideOrMask = 0x00
38 | WrOverrideAndMask = 0xFFFFFFFF
39 | WrOverrideAddr = 0xFFFFFFFF
40 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/pin_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.c
2 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/pin_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.c
2 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/gpio_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.c
2 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
4 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 | .\objects\gpio_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
11 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex1/Timer0_Ex1.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
4 | #define MR0_Value 250000 //
5 | #define PR0_Value 0
6 |
7 | //*********** Function name: Timer0_IRQHandler
8 |
9 | void TIMER0_IRQHandler (void)
10 | {
11 | LPC_TIM0->IR = 1; /* clear interrupt flag */
12 | LPC_GPIO2->FIOPIN++;
13 | return;
14 | }
15 | //*************************************************
16 | void init_timer0( ) // 10ms
17 | {
18 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
19 | LPC_TIM0->MR0 = MR0_Value; //Timer Interval
20 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
21 | NVIC_EnableIRQ(TIMER0_IRQn);
22 | LPC_TIM0->TCR = 1; // enable_timer0
23 | }
24 | //**************Main Function main()
25 | int main (void)
26 | {
27 | LPC_GPIO2->FIODIR = 0x000000FF; /* P2.0...P2.7 defined as Outputs */
28 | init_timer0( ); // 10ms
29 | while (1)
30 | { /* Loop forever */
31 | }
32 | }
33 | //*************** End Of File
34 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/3/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | int toggle = 1;
4 | #define MR_Value 200
5 | #define PR0_Value 0
6 |
7 |
8 | void Init_Timer2(){
9 | LPC_SC->PCLKSEL1 |= (0x3<<12); //set timer clk = 1/8 cpu clk - user manual page 58
10 | LPC_TIM2->PR = PR0_Value; //set prescaler to zero
11 | LPC_TIM2->MR2 = MR_Value; //Timer interval
12 | LPC_TIM2->MCR = (0x3<<6); //011 intrrupt and reset on MR2 - user manual page 505
13 | LPC_TIM2->EMR=(0x3<<8); //toggle MR2 - user manual page 507
14 | NVIC_EnableIRQ(TIMER2_IRQn);
15 | LPC_TIM2->TCR = 1; //enable Timer
16 | }
17 |
18 | void TIMER2_IRQHandler(){
19 | LPC_TIM1->IR = 1;
20 |
21 | if(toggle==1)
22 | {
23 | LPC_GPIO0->FIOPIN1 = 1;
24 | toggle=0;
25 | }
26 | else {
27 | LPC_GPIO0->FIOPIN1 = 2;
28 | toggle=1;
29 | }
30 |
31 |
32 | }
33 |
34 |
35 | int main(){
36 | LPC_GPIO0->FIODIR |= (3<<8);
37 |
38 |
39 | Init_Timer2();
40 | while(1)
41 | {
42 |
43 | }
44 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/pin_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.c
2 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
4 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
11 | .\objects\pin_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
12 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_01/4/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 |
10 | mov r0,#4-1
11 | ldr r1, =NumberInROMVahed
12 | ldr r5, =NumberInROMNomre
13 | ldr r4, =NumberInRAM
14 | ldrb r2 , [r1]; read first data from flash
15 | ldrb r3 , [r5]; read first data from flash
16 | mul r8,r2,r3 ;r8 = r8 + (r1*r2)
17 | add r6,r2 ; jame vahed ha
18 | add r9,r8 ; majmoe vahed*nomre hame doros
19 |
20 | TestNextByte
21 |
22 |
23 | add r1,#1
24 | add r5,#1
25 | ldrsb r2 , [r1];
26 | ldrsb r3 , [r5];
27 |
28 | mul r8,r2,r3
29 | add r6,r2 ; jame vahed ha
30 | add r9,r8 ; majmoe vahed*nomre hame doros
31 |
32 |
33 | str r8,[r4]
34 | add r4,#4
35 |
36 | subs r0,#1
37 | bne TestNextByte
38 |
39 | sdiv r10,r9,r6
40 |
41 |
42 |
43 | loop
44 | b loop
45 |
46 | NumberInROMVahed DCB 1,3,3,2
47 | NumberInROMNomre DCB 17,20,18,15
48 | AREA MYData , DATA , READWRITE
49 | COMMON NumberInRAM ,6 ,4
50 | end
51 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/4/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | #define PR0_Value 0
4 | #define N_Value 12
5 |
6 | void TIMER2_IRQHandler (void)
7 | {
8 | LPC_TIM2->IR = 1; // clear interrupt flag
9 | LPC_GPIO2->FIOPIN++;
10 |
11 | }
12 | //
13 |
14 | int init_timer2(void)
15 | {
16 | LPC_SC->PCONP |= (1<<22);
17 | LPC_PINCON->PINSEL0 |= (0x3 << 8); // CAP2.0
18 | LPC_TIM2->CTCR = 0x1; // counter
19 | LPC_TIM2->PR = PR0_Value; // set prescalar to 0
20 | LPC_TIM2->MR2 = N_Value; // TIMER Interval
21 | //LPC_TIM2->CCR = 1;
22 | LPC_TIM2->MCR = 0x3; // Interrupt and Reset On MR0
23 | NVIC_EnableIRQ(TIMER2_IRQn); // enable interrupt
24 | LPC_TIM2->TCR = 1; // enable counter
25 | }
26 |
27 | int main(void)
28 | {
29 | init_timer2();
30 | LPC_GPIO2->FIODIR = 0xffffffff;
31 | while(1)
32 | {
33 | // Loop forever
34 | }
35 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/5/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | void EINT3_init ()
3 | {
4 | LPC_PINCON->PINSEL4 |= (0x01 << 26); // pin2.13 as EINT3 input
5 | LPC_SC->EXTMODE|= (1<<3); // edge sensetive
6 | LPC_SC->EXTPOLAR|= (1<<3); // Rising
7 | NVIC_SetPriority (EINT1_IRQn,1);
8 | NVIC_EnableIRQ(EINT1_IRQn);
9 | }
10 |
11 | void EINT2_init ()
12 | {
13 | LPC_PINCON->PINSEL4 |= (0x01 << 24); // pin2.13 as EINT3 input
14 | LPC_SC->EXTMODE|= (1<<2); // edge sensetive
15 | LPC_SC->EXTPOLAR|= (~(1<<2)); // Falling
16 | NVIC_SetPriority (EINT2_IRQn,1);
17 | NVIC_EnableIRQ(EINT2_IRQn);
18 | }
19 |
20 | int init_timer2(int power_bit)
21 | {
22 | LPC_SC->PCONP = (power_bit<<22);
23 | }
24 |
25 | void EINT2_IRQHandler(){
26 | init_timer2(0); // Power OFF Timer2
27 | LPC_SC->EXTINT = (1<<2); //clr flag
28 |
29 | }
30 | void EINT3_IRQHandler(){
31 | init_timer2(1); // Power ON Timer2
32 | LPC_SC->EXTINT = (1<<1); //clr flag
33 | }
34 | int main()
35 | {
36 | EINT3_init();
37 | EINT2_init();
38 |
39 | while(1)
40 | {
41 | }
42 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_01/2/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 | ; mov r0,#8
10 |
11 | ldr r1, =MyNameInROM
12 | ldr r4, =MyNameInRAM
13 | ldr r5, =MyNameInRAM
14 |
15 | TestNextByte
16 | ldrsb r3,[r1]
17 |
18 | cmp r3,#32 ;if r2==0 goto loop . why 0 ? couse 0 in our condition to break loop
19 | beq NoExchange
20 | ;mov r2,#20
21 | cmp r3,#0 ;if r2==0 goto loop . why 0 ? couse 0 in our condition to break loop
22 | beq loop
23 | sub r3 ,#32
24 |
25 | NoExchange
26 |
27 | add r1,#1 ;increment pointer
28 |
29 |
30 |
31 | strb r3,[r4] ;write data to ram
32 | strb r3,[r5] ;write data to ram
33 |
34 | add r4,#1 ;add RAM pointer with 1
35 | add r5,#1 ;add RAM pointer with 1
36 | b TestNextByte
37 |
38 | loop
39 | b loop
40 |
41 | MyNameInROM DCB "shahab shafie",0
42 | AREA MYData , DATA , READWRITE
43 | COMMON MyNameInRAM ,12 ,4
44 | COMMON MyBookInRAM ,12 ,4
45 |
46 | end
47 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/PWM/PWM_2Edge/PWM_2Edge.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | // Produce two edge PWM with different start time , periode=1500 uSec
3 | // All PWM with 500uSec High Time
4 | // Start of PWM1) 300 uSec PWM2) 500 uSecPWM3) 700 uSec
5 | #define t_100uSec 2500
6 | #define t_300uSec (t_100uSec * 3)
7 | #define t_500uSec (t_100uSec * 5)
8 | #define t_700uSec (t_100uSec * 7)
9 | #define t_1500uSec (t_100uSec * 15)
10 |
11 | void initPWM1()
12 | {
13 | LPC_PINCON->PINSEL4 |= (1<<2)|(1<<6) | (1<<10); //0x444;
14 | LPC_PWM1->MR0 = t_1500uSec;
15 | LPC_PWM1->MR1 = t_300uSec;
16 | LPC_PWM1->MR2 = t_300uSec + t_500uSec;
17 | LPC_PWM1->MR3 = t_500uSec;
18 | LPC_PWM1->MR4 = t_500uSec + t_500uSec;
19 | LPC_PWM1->MR5 = t_700uSec;
20 | LPC_PWM1->MR6 = t_500uSec + t_700uSec;
21 | LPC_PWM1->MCR = 0x2; //Reset Counter When Match0 occured
22 | LPC_PWM1->PCR = (1<<2)|(1<<4)|(1<<6)|(1<<10)|(1<<12)|(1<<14); //0x5454; // Select Two Edge & Enable PWM
23 | LPC_PWM1->LER = 0x7F; // Update Shadow Reg. MR0-MR6
24 | LPC_PWM1->TCR = 0x9; //Counter & PWM Enable
25 | }
26 |
27 | int main()
28 | {
29 | initPWM1();
30 | while(1);
31 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex1 - Copy/Timer0_Ex1.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
4 | #define MR0_Value 250000 //
5 | #define PR0_Value 0
6 | char DutyCycle[10]={10,90,20,80,30,70,40,60,50,50},i;
7 |
8 | //*********** Function name: Timer0_IRQHandler
9 |
10 | void TIMER0_IRQHandler (void)
11 | {
12 | LPC_TIM0->IR = 1; /* clear interrupt flag */
13 | LPC_TIM0->MR0 = MR0_Value*DutyCycle[i]; //Timer Interval
14 | i++;
15 | if(i==10)=i=0;
16 | LPC_GPIO2->FIOPIN++;
17 | return;
18 | }
19 | //*************************************************
20 | void init_timer0( ) // 10ms
21 | {
22 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
23 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
24 | NVIC_EnableIRQ(TIMER0_IRQn);
25 | LPC_TIM0->TCR = 1; // enable_timer0
26 | }
27 | //**************Main Function main()
28 | int main (void)
29 | {
30 | LPC_GPIO2->FIODIR = 0x000000FF; /* P2.0...P2.7 defined as Outputs */
31 | init_timer0( ); // 10ms
32 | while (1)
33 | { /* Loop forever */
34 | }
35 | }
36 | //*************** End Of File
37 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/PWM/PWM_2Edge_Azmon9803/PWM_2Edge_Azmoon9803.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | // Produce two edge PWM with different start time , periode=2000 usec
3 | #define MR0_value 2000*25 //2000 usec
4 | #define MR1_value 30*25
5 | #define MR2_value 130*25
6 | #define MR4_value 130*25
7 | #define MR5_value 30*25
8 |
9 | void PWM1_IRQHandler (void)
10 | {
11 |
12 | LPC_PWM1->LER = 0x14; // Load Shadow MR1 , MR4 in MRx
13 | LPC_PWM1->IR = 0x1; /* Clear Interrupt Flag */
14 | LPC_PWM1->MR2 = MR1_value+ ( (LPC_GPIO0->FIOPIN0&0x0f)*100*25) ;
15 | LPC_PWM1->MR4 = MR5_value+ ( (LPC_GPIO0->FIOPIN0&0x0f)*100*25) ;
16 |
17 | return;
18 | }
19 |
20 | void initPWM1()
21 | {
22 | LPC_PINCON->PINSEL4 |= ( (0x01<<2) | (0x01<<8)) ;
23 | LPC_PWM1->MR0 = MR0_value;
24 | LPC_PWM1->MR1 = MR1_value;
25 | LPC_PWM1->MR2 = MR2_value;
26 | LPC_PWM1->MR4 = MR4_value;
27 | LPC_PWM1->MR5 = MR5_value;
28 | LPC_PWM1->MCR = 0x3;
29 | LPC_PWM1->PCR = 0x2424;
30 | LPC_PWM1->LER = 0x37;
31 | LPC_PWM1->TCR = 0x9;
32 | NVIC_EnableIRQ(PWM1_IRQn);
33 |
34 | }
35 |
36 | int main()
37 | {
38 | initPWM1();
39 | while(1);
40 | }
41 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/8/main.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
3 | #define MR0_Value 8 //
4 | #define PR0_Value 0
5 | #define MR1_Value 8+14
6 |
7 | //*********** Function name: Timer3_IRQHandler
8 |
9 | void TIMER3_IRQHandler (void)
10 | {
11 | LPC_TIM3->IR = 1; /* clear interrupt flag */
12 | LPC_TIM3->IR = 2; /* clear interrupt flag */
13 | LPC_GPIO0->FIOPIN++;
14 | return;
15 | }
16 | //*************************************************
17 | void init_timer3( )
18 | {
19 | LPC_PINCON->PINSEL1 |= (0x3<<14);
20 | LPC_TIM3->PR = PR0_Value; //set prescaler to zero
21 | LPC_TIM3->MR0 = MR0_Value; //Timer Interval
22 | LPC_TIM3->MR1 = MR1_Value; //Timer Interval
23 | LPC_TIM3->MCR = (3<<3) | (1); // Interrupt and Reset on MR0
24 | NVIC_EnableIRQ(TIMER3_IRQn);
25 | LPC_TIM3->CTCR = 1; // Counter with both edge of cap3.0
26 | LPC_TIM3->TCR = 1; // enable_timer0
27 | }
28 | //**************Main Function main()
29 | int main (void)
30 | {
31 | LPC_GPIO0->FIODIR = 0xFFFFFFFF;
32 | init_timer3( );
33 | while (1)
34 | { /* Loop forever */
35 | }
36 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/EXINTs with priority/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | void EINT1_init ()
4 | {
5 |
6 |
7 | LPC_PINCON->PINSEL4 |= (0x01 << 22); // pin2.13 as EINT3 input
8 | LPC_SC->EXTMODE|= (1<<1); // edge sensetive
9 | LPC_SC->EXTPOLAR|= (~(1<<1)); // Falling
10 | NVIC_SetPriority (EINT1_IRQn,1);
11 | NVIC_EnableIRQ(EINT1_IRQn);
12 | }
13 |
14 | void EINT2_init ()
15 | {
16 |
17 | LPC_PINCON->PINSEL4 |= (0x01 << 24); // pin2.13 as EINT3 input
18 | LPC_SC->EXTMODE|= (1<<2); // edge sensetive
19 | LPC_SC->EXTPOLAR|= (~(1<<2)); // Falling
20 | NVIC_SetPriority (EINT2_IRQn,2);
21 | NVIC_EnableIRQ(EINT2_IRQn);
22 | }
23 |
24 |
25 |
26 |
27 |
28 | void EINT2_IRQHandler(){
29 |
30 | LPC_GPIO2->FIOSET0=2;
31 | for(int i =0;i<20000000;i++);
32 | LPC_GPIO2->FIOCLR0 = 2;
33 | LPC_SC->EXTINT = (1<<2);
34 |
35 | }
36 | void EINT1_IRQHandler(){
37 | LPC_GPIO2->FIOSET0=1;
38 | for(int i =0;i<20000000;i++);
39 | LPC_GPIO2->FIOCLR0 = 1;
40 | LPC_SC->EXTINT = (1<<1);
41 |
42 | }
43 |
44 | int main()
45 | {
46 |
47 | LPC_GPIO2->FIODIR=0xff;
48 |
49 |
50 | EINT1_init();
51 | EINT2_init();
52 |
53 | while(1)
54 | {
55 | }
56 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/PWM/PWM0/PWM_1Edge.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | //Produce four single edge PWM with 10msec periode and different duty cycle
3 | #define MR0_VALUE 250000 // For 10ms
4 | #define MR1_VALUE 187500 // For 75% 10ms
5 | #define MR2_VALUE 80000 // For 32% 10ms
6 | #define MR3_VALUE 200000 // For 80% 10ms
7 | #define MR4_VALUE 62500 // For 25% 10ms
8 | #define Prescaler 0
9 | void init_PWM(){
10 | //0001-1110-0000-0000
11 | LPC_PWM1->PCR |= (0x1<<9)|(0x1<<10)|(0x1<<11)|(0x1<<12); //0x1E00; // Single edge and enable PWM output
12 | //0000-0000-0000-0010
13 | LPC_PWM1->MCR = 0x02; //0x124B; Reset Counter when equal to MR0
14 | //0000-0000-0001-1111
15 | LPC_PWM1->LER = 0x1F; // enable load shadow register
16 |
17 | LPC_PWM1->PR = Prescaler;
18 | LPC_PWM1->MR0 = MR0_VALUE;
19 | LPC_PWM1->MR1 = MR1_VALUE;
20 | LPC_PWM1->MR2 = MR2_VALUE;
21 | LPC_PWM1->MR3 = MR3_VALUE;
22 | LPC_PWM1->MR4 = MR4_VALUE;
23 | LPC_PINCON->PINSEL4 |= (0x1<<0)|(0x1<<2)|(0x1<<4)|(0x1<<6);
24 | LPC_PWM1 -> TCR = 9; // Enable Counter and PWM1
25 | }
26 |
27 | int main(void){
28 |
29 | // SystemInit();
30 | init_PWM();
31 | while(1)
32 | {
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_asCounter/Timer0AsCounter.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | char timer0_counter = 0;
4 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
5 | #define MR0_Value 5 //
6 | #define PR0_Value 0
7 |
8 | //*********** Function name: Timer0_IRQHandler
9 |
10 | void TIMER0_IRQHandler (void)
11 | {
12 | LPC_TIM0->IR = 1; /* clear interrupt flag */
13 | LPC_GPIO2->FIOPIN++;
14 | return;
15 | }
16 | //*************************************************
17 | void init_timer0( ) // 10ms
18 | {
19 | timer0_counter = 0;
20 | LPC_PINCON->PINSEL3 |= (0x11<<20);
21 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
22 | LPC_TIM0->MR0 = MR0_Value; //Timer Interval
23 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
24 | NVIC_EnableIRQ(TIMER0_IRQn);
25 | LPC_TIM0->CTCR = 1; // Counter with rising edge of cap0.0
26 | LPC_TIM0->TCR = 1; // enable_timer0
27 | }
28 | //**************Main Function main()
29 | int main (void)
30 | {
31 | LPC_GPIO2->FIODIR = 0x000000FF; /* P2.0...P2.7 defined as Outputs */
32 | init_timer0( ); // 10ms
33 | while (1)
34 | { /* Loop forever */
35 | }
36 | }
37 | //*************** End Of File
38 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex4/Timer0_Ex4.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 | char timer0_counter = 0;
3 | #define MR0_Value_L_H 200
4 | #define PR0_Value 0 // pll0=2*M*f/N=2*100*12MHz/6=400MHz , Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
5 | //*********** Function name: Timer0_IRQHandler
6 | void TIMER0_IRQHandler (void)
7 | {
8 | LPC_TIM0->IR = 1; /* clear interrupt flag */
9 | LPC_TIM0->MR0 = MR0_Value_L_H;
10 | }
11 | //*************************************************
12 | void init_timer0( ) // 10ms
13 | {
14 | timer0_counter = 0;
15 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
16 | LPC_TIM0->MR0 = MR0_Value_L_H; //Timer Interval
17 | LPC_TIM0->MCR = 0x2; // Reset on MR0
18 | LPC_TIM0->EMR = 0x30; // Toggle MR0
19 | LPC_PINCON->PINSEL3 |= ( 0x3<<24); // Set pin as Match Out 0 PIN1.28
20 | LPC_SC->PCONP |= (1<<1); //Power on Timer0 (Timer 0,1 Power On as default)
21 | // NVIC_EnableIRQ(TIMER0_IRQn);
22 | }
23 | //**************Main Function main()
24 | int main (void)
25 | {
26 | init_timer0( ); // 10ms
27 | LPC_TIM0->TCR = 1;
28 | while (1)
29 | { /* Loop forever */
30 | }
31 | }
32 |
33 | //*************** End Of File
34 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/9/main.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | // Cclk=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
4 | #define MR0_Value 9
5 | #define PR0_Value 0
6 |
7 | //*********** Function name: Timer2IRQHandler
8 |
9 | void TIMER2_IRQHandler (void)
10 | {
11 | LPC_TIM2->IR = 1; /* clear interrupt flag */
12 | LPC_GPIO0->FIOPIN++;
13 |
14 | if (LPC_TIM2->CTCR == 1) // change counter input
15 | LPC_TIM2->CTCR = 5;
16 | else LPC_TIM2->CTCR = 1;
17 |
18 | return;
19 | }
20 | //*************************************************
21 | void init_timer2( )
22 | {
23 | LPC_SC->PCONP |= (1<<22);
24 | LPC_PINCON->PINSEL0 |= (0x3<<10) |(0x3<<8) ; // CAP2.0 & // CAP2.1
25 | LPC_TIM2->PR = PR0_Value; //set prescaler to zero
26 | LPC_TIM2->MR0 = MR0_Value; //Timer Interval
27 | LPC_TIM2->MCR = 3; // Interrupt and Reset on MR0
28 | NVIC_EnableIRQ(TIMER2_IRQn);
29 | LPC_TIM2->CTCR = 1; // Counter Rising edge of cap2.0
30 | LPC_TIM2->TCR = 1; // enable_timer0
31 | }
32 | //**************Main Function main()
33 | int main (void)
34 | {
35 | LPC_GPIO0->FIODIR = 0xFFFFFFFF;
36 | init_timer2( );
37 | while (1)
38 | { /* Loop forever */
39 | }
40 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/joystick_mcb1700.d:
--------------------------------------------------------------------------------
1 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Boards\Keil\MCB1700\Common\Joystick_MCB1700.c
2 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
12 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.3.0\Board\Board_Joystick.h
13 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/Objects/joystick_mcb1700.d:
--------------------------------------------------------------------------------
1 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Boards\Keil\MCB1700\Common\Joystick_MCB1700.c
2 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
12 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.3.0\Board\Board_Joystick.h
13 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex3_0/Timer3_0.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 | // Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/8=12.5 MHz
3 | #define Value_L 337500 //Pclk=12.5MHz Low Time=27 msec
4 | #define Value_H 125000 //Pclk=12.5MHz High Time=10 msec
5 | #define PR0_Value 0
6 | //*********** Function name: Timer0_IRQHandler
7 | void TIMER0_IRQHandler (void)
8 | {
9 | LPC_TIM0->IR |= 1; /* clear interrupt flag */
10 | if(LPC_TIM0->MR0 == Value_H) LPC_TIM0->MR0 = Value_L;
11 | else LPC_TIM0->MR0 = Value_H;
12 | }
13 | //*************************************************
14 | void init_timer0( ) // 10ms
15 | {
16 |
17 | LPC_PINCON->PINSEL3 |= ( 0x3<<24); // Set pin as Match Out 0 PIN1.28
18 | LPC_SC->PCLKSEL0 |= (0x3<<2); // set timer clock = 1/8 cpu clock
19 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
20 | LPC_TIM0->MR0 = Value_L; //Timer Interval
21 | LPC_TIM0->MCR = 0x3; // Interrupt and Reset 0n MR0
22 | LPC_TIM0->EMR = 0x3<<4; // Toggle MR0 00110000
23 | NVIC_EnableIRQ(TIMER0_IRQn);
24 | LPC_TIM0->TCR = 1;
25 | }
26 | //**************Main Function main()
27 | int main (void)
28 | {
29 | init_timer0();
30 | while (1)
31 | { /* Loop forever */
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/2/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 |
4 | #define MR2_Value_High 2440
5 | #define MR2_Value_Low 1220
6 | #define PR0_Value 0
7 |
8 |
9 | void Init_Timer2(){
10 | LPC_SC->PCONP |= (1<<22);
11 | LPC_PINCON->PINSEL0 |= (0x3<<16); //set pin as match out 2 pin0.8 - user manual page 117
12 | //LPC_SC->PCLKSEL1 |= (0x3<<12); //set timer clk = 1/8 cpu clk - user manual page 58
13 | LPC_TIM2->PR = PR0_Value; //set prescaler to zero
14 | LPC_TIM2->MR2 = MR2_Value_High; //Timer interval
15 | LPC_TIM2->MCR = (0x3<<6); //011 intrrupt and reset on MR2 - user manual page 505
16 | LPC_TIM2->EMR=(0x3<<8); //toggle MR2 - user manual page 507
17 | NVIC_EnableIRQ(TIMER2_IRQn);
18 | LPC_TIM2->TCR = 1; //enable Timer
19 |
20 | }
21 | void TIMER2_IRQHandler(){
22 | LPC_TIM2->IR = 1<<2; //Clr INT Flag
23 |
24 | if(LPC_TIM2->MR2 == MR2_Value_High)
25 | {
26 | LPC_TIM2->MR2 = MR2_Value_Low;
27 |
28 | }
29 | else if (LPC_TIM2->MR2 == MR2_Value_Low) {
30 | LPC_TIM2->MR2 = MR2_Value_High;
31 |
32 | }
33 | }
34 |
35 |
36 |
37 | int main(){
38 |
39 | Init_Timer2();
40 | while(1)
41 | {
42 |
43 | }
44 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/joystick_mcb1700.d:
--------------------------------------------------------------------------------
1 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Boards\Keil\MCB1700\Common\Joystick_MCB1700.c
2 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
12 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.3.0\Board\Board_Joystick.h
13 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/Timer/Timer0_Ex1_Timer2/Timer0_Ex1.c:
--------------------------------------------------------------------------------
1 | #include "lpc17xx.h"
2 |
3 | // Cclk=100Mhz , Pclk_Timer2=100MHz/2=50 MHz
4 | #define MR3_Value 50*27000 //2500000 //
5 | #define PR3_Value 0
6 |
7 | //*********** Function name: Timer2_IRQHandler
8 |
9 | void TIMER2_IRQHandler (void)
10 | {
11 | LPC_TIM2->IR = (1<<3); /* clear interrupt flag */
12 | LPC_GPIO0->FIOPIN=(LPC_GPIO0->FIOPIN<<4);
13 | return;
14 | }
15 | //*************************************************
16 | void init_timer2( ) // 10ms
17 | {
18 | LPC_SC->PCONP=(1<<22); //power on timer 2
19 | LPC_SC->PCLKSEL1|= (1<<13); // set clk timer2 as cpuclk/2
20 | LPC_TIM2->PR = PR3_Value; //set prescaler to zero
21 | LPC_TIM2->MR3 = MR3_Value; //Timer Interval
22 | LPC_TIM2->MCR = (0x3<<9); // Interrupt and Reset on MR3
23 | NVIC_EnableIRQ(TIMER2_IRQn);
24 | LPC_TIM2->TCR = 1; // enable_timer0
25 | }
26 | //**************Main Function main()
27 | int main (void)
28 | {
29 | LPC_GPIO0->FIODIR = 0xFFFFFFFF; /* P0.0...P0.32 defined as Outputs */
30 | LPC_GPIO0->FIOPIN = 0x1; /* P0.0...P0.32 defined as Outputs */
31 | init_timer2( ); // 10ms
32 | while (1)
33 | { /* Loop forever */
34 | }
35 | }
36 | //*************** End Of File
37 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/joystick_mcb1700.d:
--------------------------------------------------------------------------------
1 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Boards\Keil\MCB1700\Common\Joystick_MCB1700.c
2 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
4 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
6 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
7 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
8 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
9 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
10 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
11 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
12 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.3.0\Board\Board_Joystick.h
13 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/Abstract.txt:
--------------------------------------------------------------------------------
1 | The LCD_Blinky project is a simple program for the NXP 'LPC1768'
2 | microcontroller using Keil 'MCB1700' evaluation board and
3 | demonstrating interrupt functionality and display to graphic LCD.
4 | (compliant to Cortex Microcontroller Software Interface Standard
5 | (CMSIS v1.0))
6 |
7 | Example functionality:
8 | - Clock Settings:
9 | - XTAL = 12 MHz
10 | - PLL0 = 400 MHz
11 | - CCLK = 100 MHz
12 | - Displays rotating ARM 3D logo, each picture is displayed every
13 | 150 ms
14 | - 8 LEDs blink with speed of 50 ms, determined by SysTick Timer
15 | working in interrupt mode
16 |
17 | The Blinky program is available for target:
18 | LPC1768 Flash: runs from Internal Flash located on chip
19 | (used for production or target debugging)
20 |
21 | Notes: - In EVAL version of uVision do not rebuild the target as
22 | this example's size exceeds EVAL version limitation
23 |
24 | Picture conversion procedure:
25 | 1. Convert picture to 16 BPP (R - 5bits, G - 6bits, B - 5bits)
26 | 2. Remove header from bmp by hex editor, remaining file size should
27 | be equal to (width * height * 2) bytes
28 | 3. Convert prepared file without header to C array
29 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Add3ch_outDAC_Timer/ADC_Add3ch_outDAC_Timer.c:
--------------------------------------------------------------------------------
1 | #include /* NXP LPC17xx definitions */
2 |
3 | #define MR0_Value 12500
4 | #define PR0_Value 0 // pll0=2*M*f/N=2*100*12MHz/6=400MHz , Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
5 | int i;
6 |
7 | //*************************************************
8 | void InitDAC()
9 | {
10 | // LPC_PINCON->PINSEL1|= 0x00200000; // (0x2 << 20); // select as Aout (DAC) output of d2a port0.26
11 | }
12 | //*********** Function name: Timer0_IRQHandler
13 |
14 | void TIMER0_IRQHandler (void)
15 | {
16 | LPC_TIM0->IR = 1; /* clear interrupt flag */
17 | LPC_GPIO0->FIOPINL=((LPC_ADC->ADDR5)>>4)& 0xfff;
18 | i=i+1;
19 | LPC_DAC->DACR= (i<<6)|0x00010000;
20 | }
21 | //*************************************************
22 | void init_timer0( ) // 10ms
23 | {
24 |
25 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
26 | LPC_TIM0->MR0 = MR0_Value; //Timer Interval
27 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
28 | NVIC_EnableIRQ(TIMER0_IRQn);
29 | LPC_TIM0->TCR = 1;
30 | }
31 |
32 | int main (void) { /* Main Program */
33 |
34 | InitDAC();
35 | init_timer0();
36 | while(1)
37 | {
38 |
39 |
40 | }
41 | }
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/DAC0/ADC0.c:
--------------------------------------------------------------------------------
1 | //برنامه بنويسيد که يک متغير را هر 500 ميکروثانيه يک واحد اضافه
2 | // و به خروجي آنالوگ منتقل کند
3 | #include /* NXP LPC17xx definitions */
4 |
5 | #define MR0_Value 12500
6 | #define PR0_Value 0 // pll0=2*M*f/N=2*100*12MHz/6=400MHz , Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
7 | int i;
8 |
9 | //*************************************************
10 | void InitDAC()
11 | {
12 | LPC_PINCON->PINSEL1|= 0x00200000; // (0x2 << 20); // select as Aout (DAC) output of d2a port0.26
13 | }
14 | //*********** Function name: Timer0_IRQHandler
15 |
16 | void TIMER0_IRQHandler (void)
17 | {
18 | LPC_TIM0->IR = 1; /* clear interrupt flag */
19 | i=i+1;
20 | LPC_DAC->DACR= (i<<6);
21 | }
22 | //*************************************************
23 | void init_timer0( ) // 10ms
24 | {
25 |
26 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
27 | LPC_TIM0->MR0 = MR0_Value; //Timer Interval
28 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
29 | NVIC_EnableIRQ(TIMER0_IRQn);
30 | LPC_TIM0->TCR = 1;
31 | }
32 |
33 | int main (void) { /* Main Program */
34 |
35 | InitDAC();
36 | init_timer0();
37 | while(1)
38 | {
39 |
40 |
41 | }
42 | }
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/joystick_mcb1700.d:
--------------------------------------------------------------------------------
1 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Boards\Keil\MCB1700\Common\Joystick_MCB1700.c
2 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
3 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h
4 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h
6 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h
7 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h
8 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.7.0\CMSIS\Core\Include\mpu_armv7.h
9 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
10 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
11 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
12 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
13 | .\objects\joystick_mcb1700.o: C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.12.0\Board\Board_Joystick.h
14 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/EXT interrupt vs GPIO interrupt (occur in same time ! )/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | //gpio interrupts for ports 0 and 2 are actually tied to external interrupt 3
3 |
4 | // ***** EINT3 Initialization function *****
5 | // Setup External Interrupt
6 | void EINT3_init ()
7 | {
8 | //Set PINSEL4 [21:20] = 01 for P2.10 as gpio
9 | //LPC_PINCON->PINSEL4 &= ~(0x11 << 20);
10 | //LPC_PINCON->PINSEL4 |= (0x01 << 20);
11 |
12 | LPC_PINCON->PINSEL4 = (0x01 << 26); // pin2.13 as EINT3 input
13 | LPC_SC->EXTMODE= (1<<3); // edge sensetive
14 | LPC_SC->EXTPOLAR= (~(1<<3)); // Falling
15 | NVIC_SetPriority (EINT3_IRQn,1);
16 | NVIC_EnableIRQ(EINT3_IRQn);
17 | }
18 |
19 | // ***** EINT2 Interrupt Handler*****
20 |
21 | void GPIO_INT3_init ()
22 | {
23 | LPC_GPIOINT->IO2IntEnF = ( 1 << 13 ); // port 2 falling edge sensetive as GPIO interrupt
24 | NVIC_EnableIRQ(EINT3_IRQn);
25 | }
26 |
27 |
28 |
29 |
30 | void EINT3_IRQHandler()
31 | {
32 |
33 |
34 | if ((LPC_GPIOINT->IO2IntStatF & (1<<13))==(1<<13)){
35 | LPC_GPIO2->FIOPIN0=1; // turn on first led
36 | LPC_GPIOINT->IO2IntClr = (1 << 13 ); // Clear interrupt
37 | }
38 | if (LPC_SC->EXTINT != (1<<3)) {
39 | LPC_GPIO2->FIOPIN0=2; // turn on second led
40 | LPC_SC->EXTINT = (1<<3); // Clear interrupt
41 | }
42 |
43 | }
44 |
45 |
46 | int main()
47 | {
48 | EINT3_init();
49 | GPIO_INT3_init ();
50 | while(1)
51 | {
52 | }
53 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_03/3/main.c:
--------------------------------------------------------------------------------
1 | #include
2 | int R_ADDR2,R_ADDR5;
3 |
4 | void InitDAC() //D2A Func
5 | {
6 | LPC_PINCON->PINSEL1 |= (0x2<<20); // Select as Aout (D2A) output of D2A port0.26
7 | }
8 |
9 | void InitADC() // A2D Func
10 | {
11 | LPC_PINCON->PINSEL3 |= 0x3<<30; //select channel 5 as port 1.31
12 | LPC_PINCON->PINSEL1 |= 0x3<<18; //select channel 2 as port 0.25
13 | LPC_SC->PCONP |= (1<<12); //power on A2D
14 | LPC_ADC->ADCR |= (1<<2)|(1<<5)|(0x3<<8)|(1<<16)|(1<<21); // select channel 2,5 && ClkDic && manual start of conversion , PDN=1
15 | LPC_ADC->ADINTEN = (1<<5) ; // enable INT for channel 5
16 | NVIC_EnableIRQ(ADC_IRQn);
17 | LPC_ADC->ADCR |= (1<<24);
18 | }
19 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20 | void ADC_IRQHandler()
21 | {
22 | R_ADDR2 = (LPC_ADC->ADDR2); // clear done flag channel 2
23 | R_ADDR5 = (LPC_ADC->ADDR5); // clear done flag channel 5
24 | LPC_DAC->DACR = (R_ADDR5 + R_ADDR2)/2; // Find Avg & send it to Analog channel
25 | }
26 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 | int main (void)
28 | {
29 | InitADC();
30 | InitDAC();
31 | while(1)
32 | {
33 | //loop
34 | }
35 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/turn on led with joystick/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | char keyValue;
4 | _Bool Flag=0;
5 | int i=0;
6 |
7 | int InitGPIO()
8 | {
9 | LPC_GPIO1->FIODIR3 = 0x00; // KeyBoard Input
10 | LPC_GPIO2->FIODIR0 = 0x1f; // LED Output
11 | LPC_GPIO2->FIOPIN0 = 0x00; // All LED off
12 | return 0;
13 | }
14 |
15 |
16 | void joystick()
17 | {
18 | keyValue = LPC_GPIO1->FIOPIN3 & 0x3e;
19 |
20 | if (keyValue==0x3e) // [00111110] = 3E , All keys off
21 | {
22 | Flag = 0;
23 | return;
24 | }
25 | else
26 | {
27 | if(Flag==1)
28 | return;
29 |
30 | Flag = 1;
31 |
32 | if (keyValue==0x3c) //[00111100] = 3C
33 | {
34 | LPC_GPIO2->FIOPIN0 = 1;
35 | for(i=0;i<100000;i++);
36 | LPC_GPIO2->FIOPIN0 = 0;
37 | }
38 |
39 | else if (keyValue==0x3a) //[00111010] = 3A
40 | {
41 | LPC_GPIO2->FIOPIN0 = (1<<1);
42 | for(i=0;i<100000;i++);
43 | LPC_GPIO2->FIOPIN0 = 0;
44 | }
45 |
46 | else if (keyValue==0x36) //[00110110] = 36
47 | {
48 | LPC_GPIO2->FIOPIN0 = (1<<2);
49 | for(i=0;i<100000;i++);
50 | LPC_GPIO2->FIOPIN0 = 0;
51 | }
52 |
53 | else if (keyValue==0x2e) //[00101110] = 2E
54 | {
55 | LPC_GPIO2->FIOPIN0 = (1<<3);
56 | for(i=0;i<100000;i++);
57 | LPC_GPIO2->FIOPIN0 = 0;
58 | }
59 |
60 | else if (keyValue==0x1e) //[00011110] = 1E
61 | {
62 | LPC_GPIO2->FIOPIN0 = (1<<4);
63 | for(i=0;i<100000;i++);
64 | LPC_GPIO2->FIOPIN0 = 0;
65 | }
66 |
67 | }
68 | }
69 |
70 |
71 | int main()
72 | {
73 |
74 | InitGPIO();
75 |
76 | while(1)
77 | {
78 | joystick();
79 |
80 | }
81 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_01/5/test00.s:
--------------------------------------------------------------------------------
1 | AREA RESET , DATA , READONLY
2 | DCD 0x10008000 ;
3 | DCD Reset_Handler ;
4 |
5 | AREA MYCODE , CODE , READONLY
6 |
7 | ENTRY
8 | Reset_Handler
9 |
10 | mov r0,#3-1
11 |
12 |
13 | ldr r1, =matrix1
14 | ldr r5, =matrix2
15 | ldr r4, =NumberInRAM
16 | ldrb r2 , [r1]; read first data from flash
17 | ldrb r3 , [r5]; read first data from flash
18 | mul r8,r2,r3
19 | add r9,r8
20 | mov r6,#1
21 | mov r7,#3
22 |
23 | TestNextByte
24 |
25 | add r1,r6
26 | add r5,r7
27 |
28 | ldrb r2 , [r1];
29 | ldrb r3 , [r5];
30 |
31 | mul r8,r2,r3
32 | add r9,r8
33 |
34 | subs r0,#1
35 | bne TestNextByte
36 |
37 |
38 |
39 |
40 | str r9,[r4]
41 | add r4,#1
42 | mov r9,#0
43 | adds r10,1
44 | mov r0,#5-1
45 | subs r0,#1
46 |
47 | cmp r10,3
48 | bge NoExchange
49 |
50 |
51 |
52 | ldr r1, =matrix1
53 | ldr r5, =matrix2
54 | add r5,r10
55 | add r1,r11
56 | ldrb r2 , [r1]; read first data from flash
57 | ldrb r3 , [r5]; read first data from flash
58 |
59 | mul r8,r2,r3
60 | add r9,r8
61 |
62 |
63 |
64 | subs r0,#1
65 | bne TestNextByte
66 |
67 | NoExchange
68 |
69 | cmp r11,#6
70 | beq loop
71 |
72 | mov r10,#0
73 | add r11,#3
74 | ldr r1, =matrix1
75 | ldr r5, =matrix2
76 | add r5,r10
77 | add r1,r11
78 | ldrb r2 , [r1]; read first data from flash
79 | ldrb r3 , [r5]; read first data from flash
80 | mul r8,r2,r3
81 | add r9,r8
82 | b TestNextByte
83 |
84 |
85 | loop
86 | b loop
87 |
88 | matrix1 DCB 1,3,3,2,1,3,4,2,1
89 | matrix2 DCB 1,3,3,2,1,3,4,2,1
90 | AREA MYData , DATA , READWRITE
91 | COMMON NumberInRAM ,6 ,4
92 | end
93 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_02/6/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | int div;
3 |
4 | void EINT0_init ()
5 | {
6 | LPC_PINCON->PINSEL4 |= (0x01 << 20); // pin2.10 as EINT0 input - user manual page 119
7 | LPC_SC->EXTMODE|= 1; // edge sensetive
8 | LPC_SC->EXTPOLAR|= ~(1); // Falling
9 | NVIC_SetPriority (EINT1_IRQn,1);
10 | NVIC_EnableIRQ(EINT1_IRQn);
11 | }
12 |
13 | void EINT2_init ()
14 | {
15 | LPC_PINCON->PINSEL4 |= (0x01 << 24); // pin2.12 as EINT2 input - user manual page 119
16 | LPC_SC->EXTMODE|= (1<<2); // edge sensetive
17 | LPC_SC->EXTPOLAR|= (1<<2); // Rising
18 | NVIC_SetPriority (EINT2_IRQn,1);
19 | NVIC_EnableIRQ(EINT2_IRQn);
20 | }
21 |
22 | int init_timer2(int cpu_clk)
23 | {
24 | switch (cpu_clk) {
25 | case 8:
26 | div = 3;
27 | break;
28 | case 2:
29 | div=2;
30 | break;
31 | default:
32 | div=1;
33 | break;
34 | }
35 | LPC_SC->PCONP = (1<<22); //Power on Timer2 - user manual page 64
36 | LPC_PINCON->PINSEL0 |= (0x3<<16); //set pin as match out 2 pin0.8 - user manual page 117
37 | LPC_SC->PCLKSEL1 |= (div<<12); //set timer cpu clk - user manual page 58
38 | }
39 |
40 |
41 | void EINT2_IRQHandler(){
42 | init_timer2(8); // clk = 1/8 cpu clk
43 | LPC_SC->EXTINT = (1<<2); //clr flag
44 |
45 | }
46 | void EINT0_IRQHandler(){
47 | init_timer2(2); // clk = 1/2 cpu clk
48 | LPC_SC->EXTINT = (1<<1); //clr flag
49 | }
50 |
51 | int main()
52 | {
53 | EINT0_init();
54 | EINT2_init();
55 |
56 | while(1)
57 | {
58 | }
59 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_ShowonBar/IRQ.c:
--------------------------------------------------------------------------------
1 | /******************************************************************************/
2 | /* IRQ.C: IRQ Handlers */
3 | /******************************************************************************/
4 | /* This file is part of the uVision/ARM development tools. */
5 | /* Copyright (c) 2005-2009 Keil Software. All rights reserved. */
6 | /* This software may only be used under the terms of a valid, current, */
7 | /* end user licence from KEIL for a compatible version of KEIL software */
8 | /* development tools. Nothing else gives you the right to use this software. */
9 | /******************************************************************************/
10 |
11 |
12 | unsigned long ticks = 0;
13 | unsigned char ClockLEDOn; /* On for 30 ms every 50 ms */
14 | unsigned char ClockLEDOff; /* On for 20 ms every 50 ms */
15 | unsigned char ClockANI; /* Clock for Animation 150 ms */
16 |
17 |
18 | void SysTick_Handler (void) { /* SysTick Interrupt Handler (10ms) */
19 | ticks++;
20 | switch (ticks) {
21 | case 3:
22 | ClockLEDOff = 1;
23 | break;
24 | case 5:
25 | ClockLEDOn = 1;
26 | break;
27 | case 8:
28 | ClockLEDOff = 1;
29 | break;
30 | case 10:
31 | ClockLEDOn = 1;
32 | break;
33 | case 13:
34 | ClockLEDOff = 1;
35 | break;
36 | case 15:
37 | ticks = 0;
38 | ClockANI = 1;
39 | ClockLEDOn = 1;
40 | default:
41 | break;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/ADC_Timer.c:
--------------------------------------------------------------------------------
1 | #include /* NXP LPC17xx definitions */
2 | #define MR0_Value 125000 // 500uSec
3 | #define PR0_Value 0 // pll0=2*M*f/N=2*100*12MHz/6=400MHz , Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
4 | int i;
5 |
6 | void InitADC()
7 | {
8 | LPC_PINCON->PINSEL3= (0x3 << 30); // select ad5 as input of a2d port1.31
9 | LPC_SC->PCONP |= (1<<12); // power on a2d
10 | LPC_ADC->ADCR = 0x00200320; // select chanel & maual start of conversion
11 | LPC_ADC->ADCR |= 0x01000000; // start of conversion
12 | }
13 | //*************************************************
14 | void InitDAC()
15 | {
16 | LPC_PINCON->PINSEL1|= 0x00200000; // (0x2 << 20); // select as Aout (DAC) output of d2a port0.26
17 | }
18 | //*********** Function name: Timer0_IRQHandler
19 |
20 | void TIMER0_IRQHandler (void)
21 | {
22 | LPC_TIM0->IR = 1; /* clear interrupt flag */
23 | LPC_GPIO0->FIOPINL=((LPC_ADC->ADDR5)>>4)& 0xfff;
24 | i=i+1;
25 | LPC_DAC->DACR= (i<<6)|0x00010000;
26 | LPC_ADC->ADCR |= 0x01000000; // start of conversion
27 | return;
28 | }
29 | //*************************************************
30 | void init_timer0( ) // 10ms
31 | {
32 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
33 | LPC_TIM0->MR0 = MR0_Value; //Timer Interval
34 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
35 | NVIC_EnableIRQ(TIMER0_IRQn);
36 | LPC_TIM0->TCR = 1;
37 | }
38 |
39 | int main (void) { /* Main Program */
40 |
41 | InitADC();
42 | InitDAC();
43 | init_timer0();
44 | LPC_GPIO0->FIODIRL=0x0fff;
45 | while(1)
46 | {
47 | }
48 | }
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer/Objects/spi_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.c
2 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
3 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
4 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.h
6 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
7 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
8 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
9 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
10 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
11 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
12 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
13 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
14 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_SPI.h
15 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_Common.h
16 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
17 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\Device\LPC1768\RTE_Device.h
18 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\RTE_Components.h
19 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC_Timer_Bar/Objects/spi_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.c
2 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
3 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
4 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.h
6 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
7 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
8 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
9 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
10 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
11 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
12 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
13 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
14 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_SPI.h
15 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_Common.h
16 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
17 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\Device\LPC1768\RTE_Device.h
18 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\RTE_Components.h
19 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) text on LCD/ADC_Timer_Bar/Objects/spi_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.c
2 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
3 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
4 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.h
6 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
7 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
8 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
9 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
10 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
11 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
12 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
13 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
14 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_SPI.h
15 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_Common.h
16 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
17 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\Device\LPC1768\RTE_Device.h
18 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\RTE_Components.h
19 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language (Lab)/Displaying Scrolling (Moving) puls on LCD - Copy/ADC_Timer_Bar/Objects/spi_lpc17xx.d:
--------------------------------------------------------------------------------
1 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.c
2 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
3 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\GPIO_LPC17xx.h
4 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
5 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\SPI_LPC17xx.h
6 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\LPC17xx.h
7 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cm3.h
8 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmInstr.h
9 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\cmsis_armcc.h
10 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include\core_cmFunc.h
11 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\Device\Include\system_LPC17xx.h
12 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\Keil\LPC1700_DFP\2.3.0\RTE_Driver\PIN_LPC17xx.h
13 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
14 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_SPI.h
15 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Driver\Include\Driver_Common.h
16 | .\objects\spi_lpc17xx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
17 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\Device\LPC1768\RTE_Device.h
18 | .\objects\spi_lpc17xx.o: E:\Sajjad\Lessons\MicroLPC1768\LPC1768\Example\ADC_Timer_Bar\RTE\RTE_Components.h
19 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Assignment_03/2/main.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 | #define MR0_val 1375000
3 | long int MR5_val = (1375000*30)/100;
4 | long int MR6_val = (1375000*45)/100;
5 | #define PR0_Value 0
6 | int i=0;
7 |
8 | int init_MR_Val();
9 |
10 | void initPWM1()
11 | {
12 | LPC_PINCON->PINSEL4 |= (1<<10); //PWM1.6;
13 | LPC_PWM1->MR0 = MR0_val;
14 | LPC_PWM1->MR5 = MR5_val;
15 | LPC_PWM1->MR6 = MR5_val + MR6_val;
16 | LPC_PWM1->MCR = 0x3; //Reset Counter & INT When Match0 occured
17 | LPC_PWM1->PCR = (1<<6)|(1<<14); // Select Two Edge & Enable PWM for PWM6
18 | LPC_PWM1->LER = 0x61; // Update Shadow Reg. MR0 & MR5 & MR6 - (0000-0000-0110-0001)
19 | LPC_PWM1->PR = PR0_Value;
20 | NVIC_EnableIRQ(PWM1_IRQn);
21 | LPC_PWM1->TCR = 0x9; //Counter & PWM Enable
22 | }
23 |
24 |
25 | void PWM1_IRQHandler()
26 | {
27 | LPC_PWM1->IR = (1<<0); //clr flag
28 | //i++;
29 | //LPC_GPIO0->FIOPIN0=i;
30 | init_MR_Val();
31 |
32 | }
33 |
34 | int init_MR_Val(){
35 | i++;
36 | LPC_GPIO2->FIOPIN0 = i;
37 |
38 | char port = LPC_GPIO0->FIOPIN0 & 0x0F;
39 | int high_Val;
40 |
41 |
42 | if (port == 1) high_Val = 10;
43 | else if (port == 2) high_Val = 20;
44 | else if (port == 3) high_Val = 30;
45 | else if (port == 4) high_Val = 40;
46 | else if (port == 5) high_Val = 50;
47 | else if (port == 6) high_Val = 60;
48 | else if (port == 7) high_Val = 70;
49 | else if (port == 8) high_Val = 80;
50 | else if (port == 9) high_Val = 90;
51 | else high_Val = 50;
52 |
53 | MR5_val = (MR0_val*(100-high_Val)/2) / 100;
54 | MR6_val = (MR0_val*high_Val) / 100 ;
55 |
56 | LPC_PWM1->MR5 = MR5_val;
57 | LPC_PWM1->MR6 = MR5_val + MR6_val;
58 | LPC_PWM1->LER = 0x61;
59 |
60 | }
61 |
62 |
63 | int main()
64 | {
65 | initPWM1();
66 | while(1);
67 | }
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/A2D/ADC1/ADC1.c:
--------------------------------------------------------------------------------
1 | // برنامه اي بنويسيد که هر 500 ميکرو ثانيه مقدار وردي 5 آنالوگ را به ديجيتال تبديل
2 | // کرده و در پورت 0 نشان دهيد. همينطور 3 برابر آن را به خروجي آنالوگ منتقل کند
3 | #include /* NXP LPC17xx definitions */
4 | #define MR0_Value 12500 // 500uSec
5 | #define PR0_Value 0 // pll0=2*M*f/N=2*100*12MHz/6=400MHz , Cclk=PLL0/4=100Mhz , Pclk_Timer0=100MHz/4=25 MHz
6 | int i;
7 | //*************************************************
8 | void InitDAC()
9 | {
10 | LPC_PINCON->PINSEL1|= (0x2 << 20); // select as Aout (DAC) output of d2a port0.26
11 | }
12 | //*************************************************
13 | void InitADC()
14 | {
15 | LPC_PINCON->PINSEL3= (0x3 << 30); // select ad5 as input of a2d port1.31
16 | LPC_SC->PCONP |= (1<<12); // power on a2d
17 | LPC_ADC->ADCR = (0x1<<5)|(0x3<<8)|(0x1<<21); // select chanel & ClkDiv & PDN=1
18 | LPC_ADC->ADCR |= (0x1<<24); // start of conversion
19 | }
20 | //*********** Function name: Timer0_IRQHandler
21 | void TIMER0_IRQHandler (void)
22 | {
23 | LPC_TIM0->IR = 1; /* clear interrupt flag */
24 | LPC_DAC->DACR= ((LPC_ADC->ADDR5*3)&0xffff);
25 |
26 | LPC_GPIO0->FIOPINL=((LPC_ADC->ADDR5)>>4)& 0xfff;
27 | LPC_ADC->ADCR |= (0x1<<24); // start of conversion
28 | return;
29 | }
30 | //*************************************************
31 | void init_timer0( ) // 500us
32 | {
33 | LPC_TIM0->PR = PR0_Value; //set prescaler to zero
34 | LPC_TIM0->MR0 = MR0_Value; //Timer Interval
35 | LPC_TIM0->MCR = 3; // Interrupt and Reset on MR0
36 | NVIC_EnableIRQ(TIMER0_IRQn);
37 | LPC_TIM0->TCR = 1;
38 | }
39 | int main (void) { /* Main Program */
40 | InitADC();
41 | init_timer0();
42 | LPC_GPIO0->FIODIRL=0x0fff;
43 | while(1)
44 | {
45 | }
46 | }
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Microprocessor & Assembly language/Test Codes/PWM/PWM_INT/PWM_INT.c:
--------------------------------------------------------------------------------
1 | #include "LPC17xx.h"
2 |
3 | //#define P1000 250000 // For 100% 10ms
4 | #define P100 375000 // For 100% 15ms
5 |
6 | #define P20 0.2*P100 // For 20% P100
7 | #define P80 0.8*P100 // For 80% P100
8 | //#define P50 0.5*P100 // For 50% P100
9 | #define P10 0.1*P100 // For 10% P100
10 | //#define P5 0.05*P100 // For 5% P100
11 | //#define P0 0 // For 0% P100
12 |
13 | #define Prescaler 0
14 | int DutyCycle1,DutyCycle2;
15 | int dir1, dir2; // 1 is Incremental Pulse and 0 is Decreasing Pulse
16 |
17 | void PWM1_IRQHandler (void)
18 | {
19 | // if( (LPC_PWM1->IR & 0x1) == 0x1){ // Interup for MR0
20 |
21 | // For PWM1 (OutPut1)
22 | if (dir1) LPC_PWM1->MR1 = LPC_PWM1->MR1 + P10;
23 | else LPC_PWM1->MR1 = LPC_PWM1->MR1 - P10;
24 | if (LPC_PWM1->MR1 == P20) dir1 = 1; // Set For Increment
25 | else if (LPC_PWM1->MR1 == P80) dir1 = 0; // Set For Decrement
26 |
27 |
28 |
29 | LPC_PWM1->LER = 0x6; // Load Shadow MRx in MRx
30 | LPC_PWM1->IR = 0x1; /* Clear Interrupt Flag */
31 |
32 | return;
33 | }
34 |
35 |
36 |
37 | void init_PWM(){
38 | LPC_PINCON->PINSEL4 |= 0x5; // select function 1 for p2.0 and p2.1 as Pwm1.1 and PWM1.2 Outputs
39 | //0000-0110-0000-0000
40 | LPC_PWM1->PCR = 0x600; // Select One Edge and enable PWM1 , PWM2 Output
41 | //0001-0000-0000-0011
42 | LPC_PWM1->MCR = 0x3; //Enable Interrupt MR0 & Rest TC at MR0
43 | //0000-0000-0000-0111
44 | LPC_PWM1->LER = 0x7; //Update Shadow register MR0,MR1,MR2
45 | LPC_PWM1->PR = Prescaler;
46 |
47 | LPC_PWM1->MR0 = P100;
48 | LPC_PWM1->MR1 = P20;
49 | // LPC_PWM1->MR2 = P0;
50 | NVIC_EnableIRQ(PWM1_IRQn);
51 | LPC_PINCON->PINSEL4 |= 0x5;
52 | }
53 |
54 | int main(void){
55 | SystemInit();
56 | dir1 = dir2 = 1;
57 | init_PWM();
58 | LPC_PWM1 -> TCR = 9; // TC Counter Enable & Enable PWM1
59 | while(1);
60 | }
61 |
62 |
--------------------------------------------------------------------------------