Software Tools
AVRWizard : code generator
AVRWizard : code generator เมื่้อกำหนดได้แล้ว โปรแกรมจะทำการสร้างโค๊ดตามที่เรากำหนด โดยโปรแกรม AVRWizard จะทำการเรียกโปรแกรม AVR Studio 4 หรือ 5 ขึ้นอยู่กับผู้พัฒนากำหนด เพื่อที่จะนำโค๊ดที่สร้างมาได้นี้ ไปสร้างเป็นโปรเจคต่อไปที่ AVR Studio (เพราะฉะนั้นจะต้องมี AVR Studio และ WINAVR GCC ติดตั้งไว้เรียบร้อยแล้ว)
ถึงแม้โปรแกรม AVRWizard จะยังเป็นเพียง Beta version ณ ขณะนี้ก็ตาม แต่ต่อไปในอนาคต โปรแกรม AVRWizard จะต้องเป็นที่นิยมอย่างแน่นอน
หน้าตาของโปรแกรม AVRWizard
|
โปรแกรม Serial Port Communication รองรับ WIN7
โปรแกรม Serial Port Communication รองรับ WIN7 หน้าตาโปรแกรม Parallax Serial Terminal v1.2.1 |
MicroXplorer โปรแกรมสำหรับคอนฟิกขาของ STM32
MicroXplorer โปรแกรมสำหรับคอนฟิกขาของ STM32 โปรแกรม
MicroXplorer เป็นโปรแกรมที่ทาง ST แจกให้เอาไปใช้งานกันฟรีๆ การใช้งานก็ไม่ยุ่งยากเลย เพียงแต่ เราเลือกเบอร์ของ ARM ที่ต้องการ แล้วทำการเลือกโหมดที่จะใช้งาน โปรแกรมก็จะทำการแสดงให้เห็นว่า โหมดที่เราเลือกนี้ ทำงานอยู่ที่ขาไหน และถ้าโหมดที่เราเลือก จำเป็นจะต้อง disable โหมดอื่นๆ โปรแกรมก็จะแสดงให้ทราบด้วย
ปล. ส่วนตัวผมเห็นว่า นอกจากโปรแกรมจะช่วยอำนวยความสะดวกในด้านการออกแบบ และกำหนดหน้าที่ขา I/O ของ ไมโครคอนโทรลเลอร์แล้ว เรายังสามรถทำการ สร้างรายงาน report ออกมาเป็นเอกสารได้อีกด้วย ซึ่งทำให้เราสามารถรวมเอกสารนี้เข้าไปในโฟวเดอร์โปรเจคของเรา เพื่อเตือนความจำได้ดีอีกด้วย ว่าเราได้ออกแบบให้ไมโครคอนโทรลเลอร์ทำงานขาไหนบ้าง นับว่าโปรแกรมนี้ มีประโยชน์อย่างยิ่งครับ ต้องขอขอบคุณบริษัท ST ที่สร้างโปรแกรมดีๆ แบบนี้ ให้เราเอามาใช้งานกันครับ
|
โปรแกรมสำหรับชาว Embedded ไว้ใช้บนมือถือ Android
โปรแกรมสำหรับชาว Embedded ไว้ใช้บนมือถือ Android ผมได้พยายามรวบรวมโปรแกรมสำหรับไว้ให้เพื่อนๆชาว Embedded ไว้ใช้งานหลากหลาย วันนี้ก็เช่นกัน ผมพยายามค้นหาโปรแกรมสำหรับชาว Embedded ไว้ใช้งาน เพื่อให้เกิดความสะดวกในการพัฒนางาน ของเรา โดยโปรแกรมที่จะนำเสนอเหล่านี้ เป็นโปรแกรมที่รันบนมือถือ Android ซึ่งเราสามารถเข้าไปดาวน์โหลดได้ใน Android Market ซึ่งโปรแกรมที่ผมจะแนะนำนี้เป็นโปรแกรมที่เกี่ยวข้องกับงาน Embedded ของเรา เรามาดูกันเลยว่ามีโปรแกรมไรบ้าง Mobile Product Selector เป็นโปรแกรมสำหรับสาวกไมโครชิพที่ไม่ควรพลาดด้วยประการทั้งปวง ครับ เป็นโปรแกรมสำหรับช่วยเลือกผลิตภัณท์ของไมโครชิพ ให้เหมาะกับงานของเรา พูดง่ายๆก็คือ ไมโครชิพทำโปรแกรมให้เราเ้ข้าไปค้นหาฐานข้อมูลผลิตภัณท์ของไมโครชิพนั่นเอง ไม่ว่าจะเป็นการค้นหาไอซีไมโครคอนโทรลเลอร์ ไอซีชิพต่างๆ ดาต้าชีท หรือแม้กระทั่ง Tool ของไมโครชิพ ก็สามารถที่เราจะค้นหาข้อมูล Information เหล่านี้ได้้ ไฟล์ประมาณ 10 MB โปรแกรม Electrodroid นี้ภูมิใจนำเสนอจริงๆ สำหรับใครที่เรียนไฟฟ้า อิเล็กทรอนิกส์ คุ้นหูคุ้นตา กันอย่างแน่นอน โปรแกรมที่มากไปด้วยสูตรการคำนวณวงจรอิเล็กทรอนิกส์ ฟรี ครับ โปรแกรมนี้ พกติดตัวไว้กันลืมครับ PICmicro Database โปรแกรมที่รวบรวมข้อมูลสรุป ของไมโครคอนโทรลเลอร์ของบริษัทไมโครชิพครับ อันนี้ ต้องขอบอกว่า ใครที่เล่น PIC แล้วไม่มีแอฟนี้ อยู่ในมือถือแล้วหล่ะก็ คุณพลาดของสำคัญแล้วครับ เพราะนอกจากโปรแกรมนี้จะได้สรุปข้อมูลสำคัญของ PIC ไว้แต่ละเบอร์แล้ว ยังมี PIN mapping ให้ดูด้วย ว่าแต่ละขาชื่ออะไร อยู่ตรงไหน นับว่า ทำออกมาได้ดีทีเดียวครับ 555 Calculator ยอดนิยมตลอกกาล กับไอซีเบอร์ 555 งานที่ต้องการความง่าย ไม่ต้องโปรแกรมมิ่งโค๊ดใดๆ เพื่อสร้างสัญญาณพัลส์ ไอซีเบอร์ 555 ก็ยังเป็นที่นิยมครองอันดับมายาวนาน ด้วยการทำงานที่สามารถทำได้หลากหลาย วงจรมาตรฐานที่มีให้เห็น ต้องคำนวณค่า R C ที่จะเอามาต่อสักหน่อย จึงจะได้รูปคลื่นอย่างที่ต้องการ โปรแกรม 555 Calculator ได้จัดเตรียมไว้ให้เพื่อนๆ แล้ว Micro Calc ถึงแม้จะยังเป็นเบต้าอยู่ก็ตาม แต่โปรแกรมนี้แหละ คือ โปรแกรมที่น้องๆ มือใหม่ หรือมือเก่าต้องการ โปรแกรมสำหรับคำนวณค่้า Register ต่างๆ ที่เราต้องการเซตค่า Module นั้นๆ บางทีการต้องมาเปิดดาต้าชีท ก็เป็นเรื่องที่น่าเบื่ออยู่ไม่ใช่น้อย ยกหน้าที่การคำนวณค่า Register ให้โปรแกรม Micro Calc เถอะครับ EveryCircuit Free ตัวนี้ ออกแนว Simulation เป็นการลากๆ อุปกรณ์อิเล็กทรอนิกส์มาวางเป็นวงจร ไม่ว่าจะเป็น R, L, C, Diode, หรือแม้แต่ Opamp มาต่อกับแหล่งจ่ายต่างๆ ทำให้เกิดเป็นวงจร แล้วทำการรัน ดู Simulation เพลิน แล้วได้ความรู้ไปอีกแบบ ลองดูครับ มีตัวอย่างให้ศึกษาเยอะเหมือนกัน สำหรับเวอร์ชั่นฟรีๆ แบบนี้ จริงๆ ยังมีอีกเยอะ แต่ ที่เอามาให้ดู พอหอมปากหอมคอ กันครับ ใครที่่ใช้มือถือระบบปฏิการ Android แล้วหล่ะก็ ไม่ควรพลาดด้วยประการทั้งปวงครับ |
Filter Pro Desktop โปรแกรมออกแบบวงจรกรองความถี่ ฟรีๆ จาก TI
Filter Pro Desktop โปรแกรมออกแบบวงจรกรองความถี่ ฟรีๆ จาก TI หน้าตาของโปรแกรมที่ได้จากการเลือกค่าเรียบร้อยแล้ว จะเห็นได้ว่า โปรแกรมได้คำนวณค่า คาปาซิเตอร์ และ ค่าความต้านทานไว้ให้เราเรียบร้อยแล้ว สะดวกมากๆ ลิ้งค์หน้าดาวน์โหลด Filter Pro Desktop |
Mister E PIC multi-calc โปรแกรมช่วยคำนวณค่า PIC's Register
Mister E PIC multi-calc โปรแกรมช่วยคำนวณค่า PIC's Register บ่อยครั้ง ในการกำหนดค่า Register เพื่อให้โมดูล ต่่างๆ ภายใน PIC microcontroller ทำงานได้ตามที่ต้องการ ในสภาวะ สภาพแวดล้อมที่ต่างกัน ไม่่ว่าจะเป็น ความถี่ของ Crystal ที่เปลี่ยนไป หรือความเร็วในการถ่ายทอดสัญญาณ ที่ต้องการต่างๆ กัน เรามักจะต้องทำการคำนวณหาค่า เพื่อกำหนดให้ Register อยู่เสมอๆ บ่อยครั้งก็เป็นงานที่น่าเบือเหมือนกัน
วันนี้ ผมมี Program Tool แนะนำดีๆ จากท่าน JENG มาฝากเพื่อนๆ ชาว www.123Microcontroller.com กันครับ โดยโปรแกรม Mister E PIC multi-Calc นี้พัฒนาโดยนาย mister-e ก็ต้องขอกล่าว "Thank you so much" ไว้ ณ ที่นี้ ด้วยครับ (ผมว่าน้ำใจของฝรั่ง เรื่องการแบ่งปันความรู้ หรือโปรแกรมพวกแจกให้ใช้ฟรี เนี้ย เค้าสุดยอดจริงๆครับ อยากให้คนไทย น่าจะนำมาใช้กันบ้างนะครับ)
หน้าตาของโปรแกรม Mister E PIC multi-calc
ถ้ามีปัญหาเรื่องโปรแกรม ก็ติดต่อไปที่ mister-e ได้เลยครับ
![]()
|
Electronics Assistant โปรแกรมช่วยงานอิเล็กทรอนิกส์
Electronics Assistant โปรแกรมช่วยงานอิเล็กทรอนิกส์ ดาวน์โหลดโปรแกรม Electronics Assistant
|
โปรแกรมรับส่งข้อมูลผ่าน Serial Port โดย Br@y++
โปรแกรมรับส่งข้อมูลผ่าน Serial Port โดย Br@y++ ในการสื่อสารระหว่างไมโครคอนโทรลเลอร์ และคอมพิวเตอร์ ช่องทางการสื่อสารทาง Serial Port ก็ยังเป็นช่องทางสื่อสารยอดนิยม ที่ยังคงใช้กันต่อมา แม้ว่าเครื่องคอมพิวเตอร์โน๊ตบุค บางยี่ห้อ จะได้ตัดช่องทางนี้ออกไปแล้วก็ตาม เราก็ยังสามารถหาตัวแปลงจาก USB to Serial มาใช้ในการติดต่อสื่่อสารระหว่างไมโครคอนโทรลเลอร์ และ พีซี อยู่ดี
วันนี้ผมขอแนะนำ โปรแกรมสำหรับใช้ในการติดต่อสื่อสารระหว่างไมโครคอนโทรลเลอร์ และ คอมพิวเตอร์ผ่านพอร์ตอนุกรม ด้วยโปรแกรมที่ชื่อว่า Terminal v1.9b ซึงพัฒนาโดย Br@y++ ต้องขอขอบคุณไว้ ณ ที่นี้ด้วย เครดิต : http://sites.google.com/site/terminalbpp/ หน้าตาของโปรแกรม ออกมามาให้ตั้งค่าได้ง่ายๆ แล้วก็สามารถตรวจสอบได้ทันที ว่าเราตั้งค่าอะไรไว้ เพราะบ่อยครั้งเราไม่สามารถที่จะติดต่อกับไมโครคอนโทรลเลอร์ได้ เนื่องจากเราตั้งค่าไว้ไม่ตรงกับที่เราโปรแกรมไว้ ที่ไมโครคอนโทรลเลอร์นั่นเอง หน้าตาของโปรแกรมครับ ![]() ดาวน์โหลดโปรแกรม Terminal V1.9b คลิก |
MCU 8051 IDE simulation
MCU 8051 IDE simulation โปรแกรม MCU 8051 IDE เป็นโปรแกรมที่พัฒนาขึ้นมา โดยทำการจำลองสภาวะแวดล้อมการทำงานให้เหมือนกับไมโครคอนโทรลเลอร์ 8051 โดยตัวโปรแกรมรองรับการเขียนภาษาซี และ Assembly โดยที่เราสามารถติดตั้ง SDCC ซึ่งมีทั้งตัวแปล Assembler และ C complier ทั้งสอง อยู่ในโปรแกรมเดียวกัน โปรแกรม MCU 8051 IDE รองรับการจำลองไมโครคอนโทรลเลอร์ตระกูล 8051 ไ้้ด้มากกว่า 79 เบอร์ของบริษัท Atmel 8051, 80C51, 8052, AT89C2051, AT89C4051, AT89C51, AT89C51RC, AT89C52, AT89C55WD,AT89LV51, AT89LV52 AT89LV55, AT89S52, AT89LS51, AT89LS52, AT89S8253, AT89S2051, AT89S4051, T87C5101, T83C5101, T83C5102, TS80C32X2, TS80C52X2, TS87C52X2, AT80C32X2, AT80C52X2, AT87C52X2, AT80C54X2, AT80C58X2, AT87C54X2, AT87C58X2, TS80C54X2, TS80C58X2, TS87C54X2, TS87C58X2, TS80C31X2, AT80C31X2, 8031, 8751, 8032, 8752, 80C31, 87C51, 80C52, 87C52, 80C32, 80C54, 87C54, 80C58, 87C58 and more ... นอกจากนี้ ยังสามารถทำการต่อวงจรจำลองได้ด้วย โดยมีอุปกรณ์อิเล็กทรอนิกส์พื้นฐาน ให้ทำการต่อทดสอบโค๊ดและวงจรของเราได้อีกด้วย ไม่ว่าจะเป็น LED , Keypad , Dot matrix LED , หรือ 7-segment การติดตั้งโปรแกรม ยกตัวอย่างเฉพาะระบบปฏิบัติการ Microsoft® Windows® เท่านั้น ก่อนติดตั้งโปรแกรม เราจะต้องทำการติดตั้งโปรแกรม ActiveTcl และหากต้องการลงโปรแกรมแปลภาษาซี ก็สามารถเลือกใช้โปรแกรม SDCC -- Small Device C Compiler (ซึ่งเป็นตัวเลือกเสริม) ซึ่งเป็นตัวคอมไพล์เลอร์ Opensource หลังจากติดตั้งโปรแกม ActiveTcl เรียบร้อยแล้ว จึงค่อยทำการติดตั้งโปรแกรม MCU 8051 IDE หลังจากติดตั้งโปรแกรมเรียบร้อยแล้ว ให้ทำการทดสอบโปรเจคตัวอย่างที่มากับโปรแกรม โดยไปที่ Project > Open > C:\Program Files\MCU 8051 IDE\demo แล้วเลือกโปรเจค Demo ขึ้่นมา แล้วทดสอบ Simulation โดยไปเลือกที่ simulator แล้วก็เลือก Start/Shutdown เสร็จแล้วจะเข้าโหมด simulation แล้วเราก็เลือก ที่ Run กำลังทำ VDO Tutorial...... |
ARMwizard โปรแกรมช่วยการตั้งค่า Register MCU ค่าย NXP
ARMwizard โปรแกรมช่วยการตั้งค่า Register MCU ค่าย NXP ตัวโปรแกรม ARMwizard จะสร้ัางค่าเริ่มต้นโค๊ดโปรแกรมให้กับไมโครคอนโทรลเลอร์ที่เราเลือก โดยค่าที่ถูกสร้างขึ้นมาจากการเลือกค่า setting มาจากหน้าต่างโปรแกรม ARMwizard ซึ่ภายในโปรแกรมประกอบไปด้วย การตั้งค่า register , การเซ็ทค่า Interrupt ซึ่งจะทำให้การเขียนโปรแกรมของเราทำงานได้สะดวก และรวดเร็วยิ่งขึ้น
ภายในโปรแกรมประกอบด้วยการตั้งค่าต่อไปนี้
What is new in v2.0.1 & v2.0 • Added profiles for LPC1751/52/54/56/58/59 • Added support for LPC17xx chips, includes LPC1763/64/65/66/67/68/69 mcu profiles • Added pin setting for open drain and repeater mode for LPC17xx • Added GPIO interrupt trigger edge selector to enable interrupts for selected GPIO pins • CLKDIV register of A/D can also be set by target sample rate ( in addition to A/D frequency) • When Timer2 & Timer3 is used the PCONP enable bit is set to enable the timer operation เบอร์ไมโครคอนโทรลเลอร์ที่รองรับ
LPC1751 (NEW)
LPC1752 (NEW)
LPC1754 (NEW)
LPC1756 (NEW)
LPC1758 (NEW)
LPC1759 (NEW)
LPC1763 (NEW)
LPC1764 (NEW)
LPC1765 (NEW)
LPC1766 (NEW)
LPC1767 (NEW)
LPC1768 (NEW)
LPC1769 (NEW)
LPC2101
LPC2102
LPC2103
LPC2104
LPC2105
LPC2106
LPC2131
LPC2132
LPC2134
LPC2136
LPC2138
LPC2141
LPC2142
LPC2144
LPC2146
LPC2148
LPC2361
LPC2362
LPC2364
LPC2365
LPC2366
LPC2367
LPC2368
LPC2377
LPC2378
LPC2387
LPC2388
LPC2420
LPC2458
LPC2460
LPC2468
LPC2470
LPC2478
ตัวอย่างโค๊ดที่ได้จากโปรแกรม ARMwizard สำหรับไมโครคอนโทรลเลอร์เบอร์ LPC21xxx 23xxx, 24xxx
/************************************************************************************ Code created using the ARMwizard, visit http://alexan.edaboard.eu ************************************************************************************/ #include <LPC2103.h> #define PWM0CON T0PWMCON #define PWM1CON T1PWMCON #define PWM2CON T2PWMCON #define PWM3CON T3PWMCON #define AD0CR ADCR #define AD0INTEN ADINTEN #define IO0PIN IOPIN #define IO0SET IOSET #define IO0DIR IODIR #define IO0CLR IOCLR /****************************************************************************** TIMER0 interrupt service function ******************************************************************************/ __irq void TIMER0_int (void) { /* write code here */ /* list of all available flags, select which to use */ T0IR = 1; /* Clear MAT0.0 interrupt flag */ T0IR = 2; /* Clear MAT0.1 interrupt flag */ T0IR = 4; /* Clear MAT0.2 interrupt flag */ T0IR = 8; /* Clear MAT0.3 interrupt flag */ T0IR = 16; /* Clear CAP0.0 interrupt flag */ T0IR = 32; /* Clear CAP0.1 interrupt flag */ T0IR = 64; /* Clear CAP0.2 interrupt flag */ /*T0IR = 128; Clear CAP0.3 interrupt flag, not usable on timer0 */ VICVectAddr = 0; /* Acknowledge Interrupt */ } /****************************************************************************** TIMER1 interrupt service function ******************************************************************************/ __irq void TIMER1_int (void) { /* write code here */ /* list of all available flags, select which to use */ T1IR = 1; /* Clear MAT1.0 interrupt flag */ T1IR = 2; /* Clear MAT1.1 interrupt flag */ T1IR = 4; /* Clear MAT1.2 interrupt flag */ T1IR = 8; /* Clear MAT1.3 interrupt flag */ T1IR = 16; /* Clear CAP1.0 interrupt flag */ T1IR = 32; /* Clear CAP1.1 interrupt flag */ T1IR = 64; /* Clear CAP1.2 interrupt flag */ T1IR = 128; /* Clear CAP1.3 interrupt flag */ VICVectAddr = 0; /* Acknowledge Interrupt */ } /****************************************************************************** EINT0 interrupt service function ******************************************************************************/ __irq void EINT0_int (void) { /* write code here */ EXTINT = 1; /* Clear EINT0 interrupt flag */ VICVectAddr = 0; /* Acknowledge Interrupt */ } /****************************************************************************** EINT2 interrupt service function ******************************************************************************/ __irq void EINT2_int (void) { /* write code here */ EXTINT = 4; /* Clear EINT2 interrupt flag */ VICVectAddr = 0; /* Acknowledge Interrupt */ } /****************************************************************************** AD0 interrupt service function ******************************************************************************/ __irq void AD0_int (void) { /* write code here */ /* read ADC result to clear interrupt flag (done) */ VICVectAddr = 0; /* Acknowledge Interrupt */ } /* Default Interrupt Function: may be called when ISR is disabled */ __irq void DefISR (void) { } int main(void) { /* P0.0: PORT0.0 (General purpose I/O) Input P0.1: PORT0.1 (General purpose I/O) Input P0.2: PORT0.2 (General purpose I/open-drain O) Input P0.3: PORT0.3 (General purpose I/open-drain O) Input P0.4: PORT0.4 (General purpose I/O) Input P0.5: PORT0.5 (General purpose I/O) Input P0.6: PORT0.6 (General purpose I/O) Input P0.7: PORT0.7 (General purpose I/O) Input P0.8: PORT0.8 (General purpose I/O) Input P0.9: PORT0.9 (General purpose I/O) Input P0.10: PORT0.10 (General purpose I/O) Input P0.11: PORT0.11 (General purpose I/O) Input P0.12: PORT0.12 (General purpose I/O) Input P0.13: PORT0.13 (General purpose I/O) Input P0.14: PORT0.14 (General purpose I/O) Input P0.15: PORT0.15 (General purpose I/O) Input P0.16: PORT0.16 (General purpose I/O) Input P0.17: PORT0.17 (General purpose I/O) Input P0.18: PORT0.18 (General purpose I/O) Input P0.19: PORT0.19 (General purpose I/O) Input P0.20: PORT0.20 (General purpose I/O) Input P0.21: PORT0.21 (General purpose I/O) Input P0.22: PORT0.22 (General purpose I/O) Input P0.23: PORT0.23 (General purpose I/O) Input P0.24: PORT0.24 (General purpose I/O) Input P0.25: PORT0.25 (General purpose I/O) Input P0.26: PORT0.26 (General purpose I/O) Input P0.27: PORT0.27 (General purpose I/O) Input P0.28: PORT0.28 (General purpose I/O) Input P0.29: PORT0.29 (General purpose I/O) Input P0.30: PORT0.30 (General purpose I/O) Input P0.31: PORT0.31 (General purpose O) Output */ PINSEL0=0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ IO0DIR=0x80000000; /* binary: 10000000_00000000_00000000_00000000 */ PINSEL1=0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ /****************************************************************************** External interrupts ******************************************************************************* Ext. interrupt 0 mode: Level sensitivity / Active low / wake on interrupt 0 is Off Ext. interrupt 2 mode: Edge sensitivity / Rising edge / wake on interrupt 2 is Off */ EXTMODE=0x04; /* binary: 00000100 */ EXTPOLAR=0x04; /* binary: 00000100 */ INTWAKE=0x0000; /* binary: 00000000_00000000 */ EXTINT=0x05; /* clear all the external interrupt flags */ VICVectAddr2 = (unsigned long) TIMER0_int; /* set interrupt vector 2 */ VICVectCntl2 = ( 0x20 | 4 ); /* enable slot & use it for TIMER0 Interrupt */ VICIntEnable |= (1<<4); /* Enable TIMER0 Interrupt */ VICVectAddr3 = (unsigned long) TIMER1_int; /* set interrupt vector 3 */ VICVectCntl3 = ( 0x20 | 5 ); /* enable slot & use it for TIMER1 Interrupt */ VICIntEnable |= (1<<5); /* Enable TIMER1 Interrupt */ VICVectAddr5 = (unsigned long) EINT0_int; /* set interrupt vector 5 */ VICVectCntl5 = ( 0x20 | 14 ); /* enable slot & use it for EINT0 Interrupt */ VICIntEnable |= (1<<14); /* Enable EINT0 Interrupt */ VICVectAddr7 = (unsigned long) EINT2_int; /* set interrupt vector 7 */ VICVectCntl7 = ( 0x20 | 16 ); /* enable slot & use it for EINT2 Interrupt */ VICIntEnable |= (1<<16); /* Enable EINT2 Interrupt */ VICVectAddr10 = (unsigned long) AD0_int; /* set interrupt vector 10 */ VICVectCntl10 = ( 0x20 | 18 ); /* enable slot & use it for AD0 Interrupt */ VICIntEnable |= (1<<18); /* Enable AD0 Interrupt */ VICDefVectAddr = (unsigned long) DefISR; /* un-assigned VIC interrupts */ /****************************************************************************** ADC0 ******************************************************************************* ADC operational ADC clk: 3,75 MHz (calculated with peripheral clock:15MHz) ADC rate: 375 Ksamples/sec burst mode, 10 clocks / 9 bit accuracy No start (only in manual mode, for burst always on) Channel 0 enabled, will generate an interrupt when conversion ends Channel 1 disabled, no interrupt Channel 2 disabled, no interrupt Channel 3 enabled, will generate an interrupt when conversion ends Channel 4 enabled, no interrupt Channel 5 disabled, no interrupt Channel 6 disabled, no interrupt Channel 7 disabled, no interrupt */ AD0CR=0x00230319; /* binary: 00000000_00100011_00000011_00011001 */ AD0INTEN=0x00000009; /* binary: 00000000_00000000_00000000_00001001 */ /****************************************************************************** Timer0 (32bit) ******************************************************************************* Counter Enabled, Counter Reset=0 Timer mode: count on rising edge of PCLK Counter clk: 15 MHz, Counts every: 66,67 ns (calculated with peripheral clock:15MHz) MCR0.1 : reset, stop, generate interrupt on compare match MCR0.3 : reset, on compare match CCR0.0 : capture on rising edge, capture on falling edge, CCR0.2 : capture on rising edge, capture on falling edge, generate interrupt on capture event, MAT0.0 : On compare match Set bit/output */ T0TCR=0x01; /* binary: 00000001 */ T0CTCR=0x00; /* binary: 00000000 */ T0TC=0x00000000; /* decimal 0 */ T0PR=0x00000000; /* decimal 0 */ T0PC=0x00000000; /* decimal 0 */ T0MCR=0x0438; /* binary: 00000100_00111000 */ T0MR0=0x00000000; /* decimal 0 */ T0MR1=0x00000208; /* decimal 520 */ T0MR2=0x00000000; /* decimal 0 */ T0MR3=0x000000C8; /* decimal 200 */ T0CCR=0x01C3; /* binary: 00000001_11000011 */ T0EMR=0x0021; /* binary: 00000000_00100001 */ PWM0CON=0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ /****************************************************************************** Timer1 (32bit) ******************************************************************************* Counter Enabled, Counter Reset=0 Timer mode: count on rising edge of PCLK Counter clk: 576,9231 KHz, Counts every: 1,73 us (calculated with peripheral clock:15MHz) MCR1.1 : reset, generate interrupt on compare match CCR1.2 : capture on falling edge, generate interrupt on capture event, CCR1.3 : capture on rising edge, capture on falling edge, */ T1TCR=0x01; /* binary: 00000001 */ T1CTCR=0x00; /* binary: 00000000 */ T1TC=0x00000000; /* decimal 0 */ T1PR=0x00000019; /* decimal 25 */ T1PC=0x00000000; /* decimal 0 */ T1MCR=0x0018; /* binary: 00000000_00011000 */ T1MR0=0x00000064; /* decimal 100 */ T1MR1=0x000000C8; /* decimal 200 */ T1MR2=0x00000000; /* decimal 0 */ T1MR3=0x00000000; /* decimal 0 */ T1CCR=0x0780; /* binary: 00000111_10000000 */ T1EMR=0x0000; /* binary: 00000000_00000000 */ PWM1CON=0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ while(1) { } } ดาวน์โหลดโปรแกรม ARMwizard
เครดิต http://alexan.edaboard.eu/ |
1-10 of 31