PIC16F15323 / ADC / sleep
Admin HWnews
hwnews na cncnet.info
Pondělí Srpen 12 13:42:11 CEST 2019
Zde je celej zdrojak...
https://pastebin.com/y8MnmzR9
v podstate vsechno co pisete jsem udelal...
chodi mi timer6 z LFINTOSC 32kHz - preruseni jak ma byt po 1s
AD prevodnik take funguje...neni problem zavolat prevod...a dostat vysledek
jakmile zapnu autotrigger tak to jede jak splasene..tohle je ten vypis z
preruseni:
20:44:18.462> 1....1....2156....108....0....
20:44:18.462> 2....0....2143....95....0....
20:44:18.462> 3....1....2153....105....0....
20:44:18.462> 4....1....2152....104....0....
20:44:18.462> 5....1....2152....104....0....
20:44:18.462> 6....1....2153....105....0....
20:44:18.462> 7....1....2143....95....0....
20:44:18.462> 8....1....2152....104....0....
20:44:18.462> 9....1....2154....106....0....
20:44:18.462> 10....1....2154....106....0....
20:44:18.524> 11....1....2139....91....0....
20:44:18.524> 12....1....2139....91....0....
20:44:18.524> 13....1....2151....103....0....
20:44:18.524> 14....1....2151....103....0....
20:44:18.524> 15....1....2139....91....0....
20:44:18.524> 16....1....2149....101....0....
20:44:18.524> 17....0....2144....96....0....
20:44:18.524> 18....0....2151....103....0....
20:44:18.524> 19....1....2154....106....0....
20:44:18.524> 20....1....2151....103....0....
20:44:18.587> 21....1....2143....95....0....
20:44:18.587> 22....1....2144....96....0....
20:44:18.587> 23....1....2151....103....0....
20:44:18.587> 24....1....2148....100....0....
20:44:18.587> 25....0....2144....96....0....
20:44:18.587> 26....0....2151....103....0....
20:44:18.587> 27....1....2153....105....0....
20:44:18.587> 28....1....2151....103....0....
20:44:18.587> 29....1....2135....87....0....
20:44:18.587> 30....1....2144....96....0....
20:44:18.587> 31....1....2152....104....0....
20:44:18.650> 32....0....2152....104....0....
20:44:18.650> 33....1....2144....96....0....
RV
Dne 12.08.2019 v 10:53 Jan Waclawek napsal(a):
> [preposielam]
>
>
> Ahoj,
>
> tak najprv k K42. Zacnite tym, ze si nastavite ADC v zakladnom rezime
> aby fungoval tak ako v 16f874, teda po GODONE =1, urobi jednu vzorku a
> tu musite programom preniest do vasej premennej, teda na pamatove
> miesto. Prenos mozete realizovat v interrupte ADIF a indikujte si ho
> dalsou LED2 na samostatnom pine. Potom si nastavte timer 2 na
> 250usec. a skontrolujte interrupt osciloskopom a LED1, ktoru tam uz
> mate. V obsluhe interuptu tim2 si pustite prevod GODONE =1. Po
> ukonceni prevodu by vam mali blikat LED1 aj LED2. Pokial toto nebude
> fungovat tak dalej by som nesiel...
>
> V dalsom kroku by som spustanie prevodu prevodnika robil automaticky
> cez funkciu auto-triger. Interrupty si nechajte zapnute a jediny kod
> ktory budu robit je blikanie ledkami. Aby ste videl, ze Vam ide aj ten
> auto triger.
>
> A ako posledne si na ten prevodnik ADC zaveste DMA kanal, ktory Vam
> automaticky prenesie vysledok do premennej.
>
> A potom si nastavte tu Vasu 1 sekundu a timer 6.
>
>
> Co sa tyka tych sleep funkcii, treba si uvedomit jednu zakladnu vec,
> ze v sleep-mode nefunguju periferie, ktore su napojene na interny takt
> fosc/4, resp. ho potrebuju. Tento sa totiz vypina v sleepe, nejde
> hlavny oscilator.
>
> Potom je sleep-idle, kedy idu periferie, ale cpu a pamat su vypnute.
>
> Doze-mode - idu periferie, ale cpu a pamat idu "spomalene".
>
> Treba si precitat, ktory takt ta ktora periferia pouziva. Mali by byt
> pri kazdej periferii samostatne poznamky a podla toho si zvolit
> nastavenie a mod.
>
> p.s.: pozor na tim1 ma samostatny low-power oscilator.
>
> A.
> _______________________________________________
> HW-list mailing list - sponsored by www.HW.cz
> Hw-list na list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list
>
Další informace o konferenci Hw-list