Jump to content
ELFORUM - Forumul electronistilor

analog output


pyu

Recommended Posts

vreau sa scot o anumita valoare a tensiunii pe un port analogic (RA1, RA2, RA3)folosesc pickit2 si CCS PIC IDE...am urmatoarea functie:void init_adc(){ // Set up RA0 as the only analog input, using VDD and VSS // as the references SETUP_ADC_PORTS(sAN0 | VSS_VDD); // Turn on ADC and use Fosc/8 as the conversion clock // (Fosc = 4MHz) SETUP_ADC(ADC_CLOCK_DIV_8); // Set channel for conversion to AN0 (on RA0) SET_ADC_CHANNEL(0); READ_ADC(ADC_START_ONLY); SETUP_VREF(VREF_LOW | 6); //pt 2.19v out}sunt incepator si nu-mi dau seama unde e greseala.... imi scoate peste tot 4.9V...10x

Link to comment
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • pyu

    4

  • cirip

    1

  • Abram Burel

    1

Popular Days

Top Posters In This Topic

vreau sa scot o anumita valoare a tensiunii pe un port analogic (RA1, RA2, RA3)

Porturile analogice sunt de intrare, nu de iesire, asa ca nu ai cum sa scoti tensiune pe acolo.Ca sa generezi un nivel analogic cu picul, se foloseste PWMul urmat de o filtrare.Cirip
Link to comment

vreau sa scot o anumita valoare a tensiunii pe un port analogic (RA1, RA2, RA3)

Porturile analogice sunt de intrare, nu de iesire, asa ca nu ai cum sa scoti tensiune pe acolo.Ca sa generezi un nivel analogic cu picul, se foloseste PWMul urmat de o filtrare.Cirip
opaaa.... asta nu am mai stiut... de asta nu am gasit nicaieri in documentatia de la ccs despre asta...am de aprins un led rgb "in mai multe" culori, credeam ca pe analogice se face... e bine ca am aflat ca prin pwm.... acuma sa vad cum se face asta...10x
Link to comment

Asta e pt concursul Vitacom ?

initial era... dar acuma o fac pentru facultate, iti dai seama ca nu am timp sa fac ce vor ei...
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines