Jump to content
ELFORUM - Forumul electronistilor
pyu

analog output

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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