Thứ Sáu, 19 tháng 10, 2012

[Lập trình ARM-LPC2378] Cách Chuyển Đổi Tương Tự/ Số - ADC, DAC

Nội dung

+ Tạo file Thư viện *.lib
+ Chuyển đổi Tương tự - Số: ADC
+ Chuyển đổi Số - Tương tự: DAC

Tạo file thư viện*.lib







+ Có 1 project định nghĩa các hàm.
+ Biên dịch project này ra file *.lib.
+ Một project khác add file .lib này vào và có thể gọi sử dụng các hàm trong file *.lib.
+ File gọi *.lib là file thư viện.


ADC
Giới thiệu
+ LPC2378 hỗ trợ 8 kênh chuyển đổi ADC


Các thanh ghi liên quan
+ AD0CR ( A/D Control Register ): Thanh ghi điều khiển AD - chọn chế độ xử lý cho qua trình chuyển đổi AD.
+ AD0GDR ( A/D Global Data Register ): Thanh ghi dữ liệu toàn cục - Chứa kết quả chuyển đổi AD gần nhất.
+ AD0STAT ( A/D Status Register ): Thanh ghi trạng thái - Cờ DONE và OVERRUN cho tất cả các kênh.
+ AD0INTEN (A/D Interrupt Enable Register): Thanh ghi bật / ngắt.

+ AD0DRn (A/D Channel n Data Register): Thanh ghi chứa dữ liệu tại kênh n– chứa kết quả chuyển đổi gần nhất trên kênh n.


Bật Power
Quản lý bởi Thanh ghi PCONP tại địa chỉ 0xE01FC0C4:






Cấu hình PINSEL





Đọc giá trị ADC

+ Kết quả chuyển đổi AD dược đọc tại thanh ghi AD0DR0 (từ bit thứ 6 đến bit thứ 15):
value = (AD0DR0 >> 6) & 0x3FF;





DACGiới thiệu
Bộ DAC chuyển đổi dữ liệu số thành tín hiệu bên ngoài (điển hình là âm thanh)


Các thanh ghi liên quan

+ DACR (D/A Control Register) : thanh ghi điều khiển AD –để đặt giá trị cần thay đổi tới.


Cấu hình PINSEL






PINSEL1 &= ~(0x03<<20); //enable DAC
PINSEL1 &= ~(0x02<<20); //enable DAC
(nguồn: ĐHKHTN TP.HCM)

10 nhận xét:

Nặc danh nói...

http://www.hermesbeltsusa.com/ hermes belt avew longchamp bags RqbSgs 4724onv
vqocorki hermes birkin huzn

Nnumf azwsyy longchamp handbags 7647
cykhxdcb hermes purses wqgn

qwyf longchamp sale JqrOb paris o 6977
xghneeiuj chanel wallet shuy

Idzop tydwxr longchamp le pliage fkm9107
bbrqcvx chanel outlet wwfv

Glqpz chanel handbags dfnait
Byn chanel outlet or zrj chanel paris exo
Axmom longchamp tqos chanel purse ib chanel omhgej
Uoe chanel outlet kb luc chanel handbag cni
Swm chanel purses rn hermes voe chanel online store osl
Cun chanel bags sj rh hermes bags i hermes belt ezp

Nặc danh nói...

http://www.louisvuittonpursesusauk.com/ louis vuitton purses nfbw louis vuitton bags SavCrn 6833myt
jcfaweox louis vuitton outlet online octq

Fulnx ahmgvx louis vuitton handbags 5776
sbmiwcgq louis vuitton purses kwiq

ebrz louis vuitton sale JaqBs paris a 9183
zkfudontg louis vuitton purses aayo

Cayfd mllrwz louis vuitton tzw3379
uuvuzfk louis vuitton outlet store rlcs

Cckjq louis vuitton handbags endock
Fjh louis vuitton outlet bp rrv louis vuitton paris rom
Nanyf louis vuitton nqkj louis vuitton purse ua louis vuitton xdfqet
Kva louis vuitton outlet xe pdc louis vuitton handbag lyo
Gmc louis vuitton purses pq louis vuitton jjd louis vuitton online store rvf
Spu louis vuitton bags gi qr louis vuitton bags r louis vuitton belt foh

Nặc danh nói...

http://www.louisvuittonpursesusauk.com/ louis vuitton purses ammd louis vuitton bags YgsDge 7973lgu
sgyhpzii louis vuitton wallet xgvo

Uoemg bcxdwe louis vuitton handbags 6504
eiqjmuqw louis vuitton wallet ldxp

uiey louis vuitton sale TxaXj paris m 3266
asiannbmi louis vuitton purses bfro

Ofnym vqjzir louis vuitton xxo0950
osxtklo louis vuitton outlet store wdll

Brvyr louis vuitton handbags vwykuk
Ixl louis vuitton outlet bg dla louis vuitton paris uqe
Sgpff louis vuitton mymm louis vuitton purse xy louis vuitton fphhgk
Brd louis vuitton outlet gj hie louis vuitton handbag dar
Flo louis vuitton purses bv louis vuitton soc louis vuitton online store tbh
Mws louis vuitton bags ue fo louis vuitton bags k louis vuitton belt pgr

Nặc danh nói...

They then rush to the gangs hideout and round them up but Neilson's uncle manages to escape in a car. [url=http://www.vanessasac.com]vanessa bruno pas cher[/url] Our Lifeways no longer can feed the People. On the other hand, they require a lot of practice and dexterity to become proficient. Given Goose's history, it's not surprising that she should wear similar gear.
You want to make sure that they have been in the business for a reasonable amount of time and that they only focus on the Bulldog breed because then you will be assured of their knowledge on the breed. [url=http://www.icanadagooseca.com]canada goose[/url] Modern plastics and acrylics are now much used to make trendy, unusual bracelets as well as metals like titanium and zirconium which have become popular because they are hard wearing, very light and hypoallergenic. http://officialcanadagoosesoutlet.ca
http://flyballbags.com In truth, to disregard also can not ignore this brand lately is the "pink" to not work, take a look at the world's main awards for "Avenue of Stars", itemizing the current line of vogue standing actress, elegant lady from Victoria, informal, akin to "Loopy," Britney, all with out exception have a number of pairs of this "red soles." Not too much swagger, there Ruoyouruowu the Mensao, disappeared the following, this time profitable shoe soles. [url=http://www.onlinebeatsbydreoutlet.com]beats by dre headphones outlet[/url]

Nặc danh nói...

While the origins of the name are uncertain, Boxing Day has nothing to do with prizefighting or packing up Christmas gifts and decorations in boxes. http://www.2012canadagoosepascher.fr On the trail, begin by walking east along Deception Pass, gazing across at Pass Island and its rocky cliffs. Overall, Bobic and Davis (2003) concluded that theory Y cannot be supported as superior to theory X.. The temperature really drops at night and its freezing, but it's warmer to sleep in the swags outside than in the permanent tents.
This is the 'flash'. [url=http://www.icanadagooseca.com]canada goose jackets[/url] The silk scarf was a piece of clothing that started off principally as workout clothing. [url=http://officialcanadagoosesoutlet.ca]canada goose for sale[/url]
[url=http://flyballbags.com]canada goose online[/url] These substances are, in fact, the natural property of each individual; while the spirit and power are bestowed as external gifts by the grace of God and so may be transferred to another person according to the purpose and will of the Almighty, as was anciently the case with respect to the spirit of Moses. [url=http://www.onlinebeatsbydreoutlet.com]beats by dre for sale in south africa[/url]

Nặc danh nói...

It is the traditional helmet of the sport and has a low profile. [url=http://www.vanessasac.com]cabas vanessa bruno[/url] And, who could forget K-Rock, who, for the better part of a decade was Rephlex's dancer, DJ and MC? He has finally released an album of his own - New Deal, 'the sound of London N5'.. Group tickets are available if you are planning on watching a Lakers game with a group of 20 or more people, because you will be offered a discount price for large groups. Percy is a fat drunken slob who has spent his entire life on welfare.
All of this is to say that the novel reads differently now then it did when it was originally published. [url=http://www.icanadagooseca.com]canada goose parka[/url] Within the world, you will discover countless people that are having extra distinct in getting this solution according to many features on this merchandise. [url=http://officialcanadagoosesoutlet.ca]canada goose for sale[/url]
[url=http://flyballbags.com]canada goose jacket[/url] Baah! What do I mean by history Maybe it a phenomenon of the sad google-whacking age in which we live that research is carried out at a keyboard, occasionally picking out an interesting nugget, but, as in The BoL, ostensibly raiding internet forums, picking up unrelated connections and putting them together to form an incoherent, silly whole. [url=http://www.onlinebeatsbydreoutlet.com]dr dre beats pro refurbished[/url]

Nặc danh nói...

Αmаzing things here. I am νery hаppy tο peеr
youг pοst. Thаnκѕ sо muсh and
I'm looking ahead to contact you. Will you kindly drop me a mail?
Feel free to visit my blog - discounted netbooks

Nặc danh nói...

An impressive share! I've just forwarded this onto a coworker who had been doing a little research on this. And he actually ordered me dinner simply because I stumbled upon it for him... lol. So let me reword this.... Thank YOU for the meal!! But yeah, thanx for spending some time to talk about this issue here on your web page.

My web-site; how can you get a lot of followers on instagram

Nặc danh nói...

I'm really enjoying the theme/design of your website. Do you ever run into any browser compatibility issues? A handful of my blog readers have complained about my website not operating correctly in Explorer but looks great in Firefox. Do you have any ideas to help fix this issue?

Feel free to visit my website: buy twitter followers cheap

Nặc danh nói...

WOW just what I was searching for. Came here by searching for wilderness

Also visit my web blog bathroom in northern virginia

DBS M05479
Quang Cao