skraceni kurs ucenja picbasica

Rasprava o PIC mikrokontrolerima, PIC projekti i drugo vezano za PIC-eve...

Moderators: pedja089, stojke369, [eDo], trax

Post Reply
User avatar
Momak
Pravo uznapredovao :)
Pravo uznapredovao :)
Posts: 304
Joined: 13-03-2011, 01:07

Re: skraceni kurs ucenja picbasica

Post by Momak »

Ok, hvala ti Pedja, videcu sta mogu, mada cu ga verovatno reklamirati.
Kad pijemo, mi se i napijemo.
Kad se napijemo, mi i zaspemo.
Kad spavamo, mi ne činimo grehe.
Ako ne činimo grehe, onda idemo u raj.
Zato i pijemo da bi otišli u raj.
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

pozdrav svima narocita pedji kurs je extra,ali nije mi jasno kako da upisem u dodatnu memoriju hex fail kako to da izvedem sa programatorom koristim all pic a radim sa kontrolerom16f877,jer mi je fles samog pica mala
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7876
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: skraceni kurs ucenja picbasica

Post by pedja089 »

Prilicno komplikovano.. Batali to. Uzmi pic sa vecom memorijom. Imas ih do 120K.
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

treba da iskucam skoro 900 paljenja sa proverama tastera,znaci nema teorije nigde da stane,a odjednom treba 8 pinova da bude na logickoj 1 pa da ceka taster,pa ako se taster stisne upali drugih 8 itd imas neko resenje,moze cak i za kompjuter pic da bude vezan,ili ako bi mogao da mi objasnis kako da krenem ja sam radio i sa case proverama,i sa definisanjem u podprogramu,pa sa gosubom da vracam al neiskucam ni osmin u proptis na hex ved 8kb
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

Evo primer ovo je 8mb hex a tek pocetak,mozda ima drugo resenje

Code: Select all

define osc 4
adcon1 = 7

' Aliasi za bitove portA
symbol Pumpa1 = porta.0
symbol Pumpa2 = porta.1
symbol Pumpa3 = porta.2
symbol Pumpa4 = porta.3

' Aliasi za bitove portE
symbol Pobuda= porte.2
symbol Taster = porte.1

' Aliasi za bitove portD
symbol Pumpa5 = portd.7
symbol Pumpa6 = portd.6
symbol Pumpa7 = portd.5
symbol Pumpa8 = portd.4
symbol Pumpa9 = portd.3
symbol Pumpa10 = portd.2
symbol Pumpa11 = portd.1
symbol Pumpa12 = portd.0

' Aliasi za bitove portC
symbol Pumpa13 = portc.7
symbol Pumpa14 = portc.6
symbol Pumpa15 = portc.5
symbol Pumpa16 = portc.4
symbol Pumpa17 = portc.3
symbol Pumpa18 = portc.2
symbol Pumpa19 = portc.1
symbol Pumpa20 = portc.0

' Definisanje ulaznih pinova
input taster

' Definisanje izlaznih pinova
output porta
output portc
output portd
output pobuda


goto program
'****************************************************************
'* Podprogrami                                                  *
'****************************************************************
Pocetak:
'    Cekanje na pritisak na taster
    while taster = 1
        pause 50
    wend
pobuda = 1
pause 1000
pobuda = 0    
'    Ako je taster i dalje pritisnut, ceka se njegovo otpustanje
    while taster = 0
        pause 50
    wend
return

'****************************************************************
'* Glavna programska petlja                                     *
'****************************************************************
Program:
high pumpa1 : high pumpa2 : high pumpa3 : high pumpa4
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa4

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa5
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa5

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa6

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa5
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa5

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa6

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa6

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa7 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa7 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa7 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa7 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa7 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa7 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa8 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa8 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa8 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa8 : low pumpa10


high pumpa1 : high pumpa2 : high pumpa9 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa9 : low pumpa10

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa5
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa5

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa6

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa7

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa8

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa9

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa10

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa6

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa7

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa8

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa9

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa10

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa7

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa8

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa9

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa10

 	
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

Ili dali bi mogli neki brojaci da se naprave,to bi jos bolje bilo
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

dzigi021 wrote:treba da iskucam skoro 900 paljenja sa proverama tastera,znaci nema teorije nigde da stane,a odjednom treba 8 pinova da bude na logickoj 1 pa da ceka taster,pa ako se taster stisne upali drugih 8 itd imas neko resenje,moze cak i za kompjuter pic da bude vezan,ili ako bi mogao da mi objasnis kako da krenem ja sam radio i sa case proverama,i sa definisanjem u podprogramu,pa sa gosubom da vracam al neiskucam ni osmin u proptis na hex ved 8mb
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

dzigi021 wrote:Evo primer ovo je 8kb hex a tek pocetak,mozda ima drugo resenje

Code: Select all

define osc 4
adcon1 = 7

' Aliasi za bitove portA
symbol Pumpa1 = porta.0
symbol Pumpa2 = porta.1
symbol Pumpa3 = porta.2
symbol Pumpa4 = porta.3

' Aliasi za bitove portE
symbol Pobuda= porte.2
symbol Taster = porte.1

' Aliasi za bitove portD
symbol Pumpa5 = portd.7
symbol Pumpa6 = portd.6
symbol Pumpa7 = portd.5
symbol Pumpa8 = portd.4
symbol Pumpa9 = portd.3
symbol Pumpa10 = portd.2
symbol Pumpa11 = portd.1
symbol Pumpa12 = portd.0

' Aliasi za bitove portC
symbol Pumpa13 = portc.7
symbol Pumpa14 = portc.6
symbol Pumpa15 = portc.5
symbol Pumpa16 = portc.4
symbol Pumpa17 = portc.3
symbol Pumpa18 = portc.2
symbol Pumpa19 = portc.1
symbol Pumpa20 = portc.0

' Definisanje ulaznih pinova
input taster

' Definisanje izlaznih pinova
output porta
output portc
output portd
output pobuda


goto program
'****************************************************************
'* Podprogrami                                                  *
'****************************************************************
Pocetak:
'    Cekanje na pritisak na taster
    while taster = 1
        pause 50
    wend
pobuda = 1
pause 1000
pobuda = 0    
'    Ako je taster i dalje pritisnut, ceka se njegovo otpustanje
    while taster = 0
        pause 50
    wend
return

'****************************************************************
'* Glavna programska petlja                                     *
'****************************************************************
Program:
high pumpa1 : high pumpa2 : high pumpa3 : high pumpa4
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa4

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa5
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa5

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa6

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa3 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa3 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa5
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa5

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa6

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa4 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa4 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa6

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa5 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa5 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa7

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa6 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa6 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa7 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa7 : low pumpa8

high pumpa1 : high pumpa2 : high pumpa7 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa7 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa7 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa7 : low pumpa10

high pumpa1 : high pumpa2 : high pumpa8 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa8 : low pumpa9

high pumpa1 : high pumpa2 : high pumpa8 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa8 : low pumpa10


high pumpa1 : high pumpa2 : high pumpa9 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa2 : low pumpa9 : low pumpa10

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa5
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa5

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa6

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa7

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa8

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa9

high pumpa1 : high pumpa3 : high pumpa4 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa4 : low pumpa10

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa6
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa6

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa7

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa8

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa9

high pumpa1 : high pumpa3 : high pumpa5 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa5 : low pumpa10

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa7
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa7

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa8
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa8

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa9
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa9

high pumpa1 : high pumpa3 : high pumpa6 : high pumpa10
gosub pocetak
low pumpa1 :low pumpa3 : low pumpa6 : low pumpa10

 	
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

dzigi021 wrote:
dzigi021 wrote:treba da iskucam skoro 900 paljenja sa proverama tastera,znaci nema teorije nigde da stane,a odjednom treba 8 pinova da bude na logickoj 1 pa da ceka taster,pa ako se taster stisne upali drugih 8 itd imas neko resenje,moze cak i za kompjuter pic da bude vezan,ili ako bi mogao da mi objasnis kako da krenem ja sam radio i sa case proverama,i sa definisanjem u podprogramu,pa sa gosubom da vracam al neiskucam ni osmin u proptis na hex ved 8kb
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

a sad dzaba izmenja 8kb zauzima
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7876
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: skraceni kurs ucenja picbasica

Post by pedja089 »

Pola nisam Pohvatao sta hoces, reci citiras sam sebe itd. Kao prvo taj program sto si napisao nema bas puno veze sa necim razumljivim. Kao drugo ako ti treba 900 sekvencim iako ne vidim kako jer imas samo na ulazima 255 stanja. Napravi tablicu iz koje povlacis stanja. Uvek se moze i brojac staviti, stace te?- Pojma nemam...
Uglavnom taj program se resi u 8K bez ikakvih problema.
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

Da imam 255 stanja*2 tj 1275 stanja,dali mi mozes dati neki primer kako da definisem paljenja pa tek tada da pozivam,ali nakon svake promene paljenja nesme da se napravi drugo stanje dok se nestisne taster
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7876
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: skraceni kurs ucenja picbasica

Post by pedja089 »

Napravi petlju koja ceka stisak tastera. A iz neke tabele samo prosledjuj vrednosti na porta. Nigde ne pise da ti moras ici sa high il low pin po pin... To bas i nema smisla. Nego stavi jednostavno porta=123
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

meni treba 256*256 paljenja
treba 8 pinova uvek da mi b ude aktivno
ja sam planirao da napravim tri labele
prva labela za proveru
druga labela za paljenje prva cetiri porta
a treca labela za paljenje druga cetiri porta
kad se upale 4 porta iz trece labele naredbom gosub bi ga vratio na drugu labelu dok je nebi celu ocitao
naravno za svaku promenu treba taster da se stisne
dali mi neko moze dati savet kako to da resim sa tabelom
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

Aha,a recimi kolika tabela moze biti velika da bi stala u pic i dati mi mali primer kako to da odradim pa bi ja kuckao,svaka cast na temi jako dobro si obradio basic
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

Razmisljam nesto poput ovog da napravim al neznam kako taster da ubacim ovao sam prekopirao sa tvog kursa a cinimi se da na to mislis

Code: Select all

Cifra var word[6]
i var byte
Cifra[0] = %11000000
Cifra[1] = %1111 1001
Cifra[2] = %1010 0100
Cifra[3] = %1011 0000
Cifra[4] = %1001 1001
Cifra[5] = %1001 0010
Cifra[6] = %1000 0010
Cifra[7] = %1111 1000
Cifra[8] = %1000 0000
Cifra[9] = %1001 1000
i=0' U i stavimo cifru koju hocemo na displeju.
portb=cifra[i]
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7876
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: skraceni kurs ucenja picbasica

Post by pedja089 »

Tabela moze biti velicine mesta koje ti ostane u kontroleru.
Primer sada nemam. Verovatno ima na picbasic.co.uk. U principu poigraj se sa READECODE, a tabelu upisi u programsku memoriju.
Pa imas kod koji broji koliko si puta stisnuo taster...
Probaj malo...
dzigi021
Penjem se :)
Penjem se :)
Posts: 71
Joined: 04-01-2012, 07:50

Re: skraceni kurs ucenja picbasica

Post by dzigi021 »

nisam te najbolje shvatio mesta kolko mi ostane u kontroleru,pa valjda treba prvo nju da napravim,pocetnik sam,dali mi mozes preporuciti neki veci kontroler sto ima 2porta sa 10 birta mora biti vise radi tastera,i ako mi preporucis samo mi napisi sta treba da definisem za njega sto se tice samog kontrolera,i da ima vise mesta,pocetnik sam unapred hvala
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7876
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: skraceni kurs ucenja picbasica

Post by pedja089 »

Pa ako imas 8K programa, po mojoj proceni program staje u 1K memorije sigurno, znaci imas 7K na raspolaganju za tu tabelu...
Tako kako si ti krenuo nece ti stati, jer imas samo 396 bajtova rama. Ali ako na taj nacin definises niz konstanti, onda mozes izvesti to... Ne znam napamet kako se to radi, idi na picbasic.co.uk, pa tamo kopaj.
Sto se tice pica pogledaj 18F seriju...
Post Reply