Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ATmega168 7-Segmentni Display
Probao sam danas u simulatoru vojinilicov asm kod za HEX2BCD i ako sam dobro vidio program se izvrsi za 787 ciklusa sto mi izgleda mnoogooo....razumijem da AVR nema HW DIV mnemonik pa mora da ide softwerski a to podrazumijeva Left Bit Shifting sa Bazom 2 (2x2x2x2x2...) i to zahtjeva puno ciklusa...ja sam malo stavio sa stranu C jezik i sinula mi danas ideja zasto nebi npr broj:

867 rastavio dijeljenjem na tri znamenke pomocu ove formule:

867 / 100 = 8,67 (uzmi 8 i pohrani ga u registar R23) R23 => 08
Uzmi ostatak 67 i podijeli ga sa 10 = 6,7 (uzmi 6 i pohrani ga u registar R24)
Uzmi ostatak 7 i pohrani ga u registar R25

R23 => 08
R24 => 06
R25 => 07

Naletim na ovu stranicu:

https://sites.google.com/site/avrasmintr...basic-math

9. DIVIDING TWO 16-BIT NUMBERS

Stavim kod u simulator, i vidim da mi uzima cijeli broj i ostatak...onda isao prouciti kod..skuzio kako radi bit shifting, i dopisao svoj kod u DONE: macro i dodao EXIT: macro...pokrenuo simulator i gle cuda...u registrima bas vrijednosti kako sam gore naveo....fantasticno....korak blize ASM i AVR-u Smile

Mnozenje sa AVR je jako lako jer ima HW mnemonik..dok za dijenjenje nema pa mora preko SW...nije mi jasno kako inzinjeri u ATMELU nisu to mogli da dodaju? Pa i digitron pored mnozenja ima i dijeljenje i zato mi nije jasno kako su mogli tako bitnu stvar da izostave....korisnici asm pica zanima me dali pic ima HW DIV i MUL mnemonik?

I sad mi jos sinula jedna ideja..posto HW mnemonik MUL u ASM uzima 2ciklusa jeli moguce ovo da se uradi? Mislim da je nemoguce da se uradi ali da pitam:

867 x 0,01= 8,67
  67 x 0,1  = 6,7

R23 => 8
R24 => 6
R25 => 7

Dobi se isto a izvrsavanje bi trebalo da bude oko 30-40ciklusa...dok za meni gore SW dijeljenje treba tocno 492 ciklusa ili tocnije receno na 18,432MHz quarzu to je 26,69uS sto mi se cini mnogooo....a sa ovim MUL ako bi se dalo bilo bi to na 40ciklusa 2,17uS sto bi bio ogromni benchmark...cak sam nasao na forumu da su se ljubitelji PIC-a nasli na forumu i isli raditi division na PICu u optimizaciju routina i dosli do takve optimizacije da su dosli blizu HW izvrsavanja mnemonika da postoji u njemu.

Evo koda i ako moze da se brzina poboljsa molim da se modificira i posta ovdje jer mi se ASM nekako najvise svidja...(nije ni C losi ali u asm kako da kazem moram da znam kako HW funckionira i onda pisem tocno tako nema kao u C pozoves interupts.h i imas tu sve vec rjeseno a u asm moras da pozivas interrupts adrese i da tocno tznas kakko timer i interrupt radi da bi to proradilo....)

Vidio sam i atmelov:

ftp://www.inf.fh-dortmund.de/pub/contrib...AVR200.PDF

fantastican dokument...kako ako se radi kratki kod ciklusi se povecavaju zbog nekih mnemonika (rjmp, brne...) koji zauzimaju 2 ciklusa....a ako se pise linija po linija..registar po registar upise compare ispis shifting dobi se cca 40% brze izvodjenje naspram kratkog koda...uz placanje cijene zauzimanje vise WORD-a u AVR-u tj FLASHa...ali posto je flash u avru ogroman nemogu ga ja bas tako lako napuniti....sada sam na nekvih 125Worda za 7seg display i to izadje 250byta flasha..sto je malo nasptam 32K....

Evo i programa pa molim vase komentare...pocenik sam ali sam uporan..i ASM je must way to go...


.rar   divider16bit.rar (Size: 1,12 KB / Downloads: 1)
SAMO-BANOVAN OD 01.11.2024
Reply


Messages In This Thread
ATmega168 7-Segmentni Display - by ronovar - 03-29-2018, 07:44 PM
RE: ATmega168 7-Segmentni Display - by Milan94 - 03-29-2018, 08:37 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-29-2018, 09:27 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 03-30-2018, 10:43 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-29-2018, 09:55 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-29-2018, 10:12 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-29-2018, 10:31 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-29-2018, 10:38 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-29-2018, 11:02 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 07:43 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-30-2018, 08:17 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 09:41 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 10:51 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 03-30-2018, 11:17 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 11:33 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 03-30-2018, 12:01 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 02:46 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 12:14 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 03-30-2018, 12:24 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 03-30-2018, 12:32 PM
RE: ATmega168 7-Segmentni Display - by Milan94 - 03-30-2018, 03:55 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 03-30-2018, 04:23 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-30-2018, 05:26 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-30-2018, 06:08 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 03-30-2018, 08:07 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 03-30-2018, 08:25 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-30-2018, 09:52 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 03-30-2018, 10:21 PM
RE: ATmega168 7-Segmentni Display - by Želja - 03-31-2018, 08:31 AM
RE: ATmega168 7-Segmentni Display - by Macola - 03-31-2018, 12:52 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 03-31-2018, 01:57 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-01-2018, 02:11 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-01-2018, 02:23 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-01-2018, 03:00 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-01-2018, 08:17 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-01-2018, 09:22 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-01-2018, 09:24 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-01-2018, 09:32 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-01-2018, 09:45 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-01-2018, 09:41 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-01-2018, 09:53 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-01-2018, 09:48 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-01-2018, 09:59 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-01-2018, 10:04 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-01-2018, 10:09 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 08:39 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-02-2018, 09:23 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-02-2018, 10:04 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:17 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 08:54 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 09:28 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-02-2018, 09:34 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 02:01 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 03:42 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 02:41 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 03:44 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 04:28 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 04:40 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-02-2018, 04:55 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 05:05 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-02-2018, 07:57 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 08:17 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 07:58 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 08:24 PM
RE: ATmega168 7-Segmentni Display - by Milan94 - 04-02-2018, 09:11 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 09:40 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 10:21 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 10:31 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 10:37 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 10:51 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:05 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 10:57 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:11 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-02-2018, 11:08 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 11:15 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:17 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 11:20 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:21 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 11:25 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:30 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-02-2018, 11:27 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:49 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 07:19 AM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 11:28 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 11:48 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-02-2018, 11:52 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-02-2018, 11:56 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-03-2018, 12:03 AM
RE: ATmega168 7-Segmentni Display - by Želja - 04-03-2018, 07:25 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-03-2018, 10:16 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 07:50 AM
RE: ATmega168 7-Segmentni Display - by 1van - 04-03-2018, 10:05 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 10:24 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 10:56 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-03-2018, 11:21 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 11:37 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-03-2018, 12:02 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 12:06 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 12:11 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-03-2018, 12:48 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 04:16 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 04:34 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 08:02 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 08:52 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 09:15 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 09:30 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 09:39 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 09:55 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 09:58 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 10:05 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-03-2018, 10:07 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 10:16 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 10:24 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 10:34 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-03-2018, 10:42 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-03-2018, 11:14 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-03-2018, 11:25 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-03-2018, 11:52 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-04-2018, 12:00 AM
RE: ATmega168 7-Segmentni Display - by Macola - 04-04-2018, 12:14 AM
RE: ATmega168 7-Segmentni Display - by 1van - 04-04-2018, 07:03 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-04-2018, 12:30 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-04-2018, 06:20 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-04-2018, 08:58 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-04-2018, 09:53 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-04-2018, 10:00 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-04-2018, 02:08 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-04-2018, 03:23 PM
RE: ATmega168 7-Segmentni Display - by Macola - 04-04-2018, 03:53 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-04-2018, 10:27 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-05-2018, 05:06 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-05-2018, 06:47 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-05-2018, 08:52 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-08-2018, 10:48 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-08-2018, 06:49 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-08-2018, 08:16 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-08-2018, 09:17 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-08-2018, 11:09 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-09-2018, 08:28 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-09-2018, 11:56 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-09-2018, 12:21 PM
RE: ATmega168 7-Segmentni Display - by Makso - 04-09-2018, 12:24 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-09-2018, 01:01 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-09-2018, 02:13 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-10-2018, 08:21 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-10-2018, 03:52 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-10-2018, 07:58 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-10-2018, 08:32 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-10-2018, 08:54 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-10-2018, 09:35 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-10-2018, 09:51 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-10-2018, 09:52 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-11-2018, 06:54 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-11-2018, 07:08 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-11-2018, 08:39 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-11-2018, 08:44 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-11-2018, 10:09 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-11-2018, 10:48 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-11-2018, 11:13 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-12-2018, 12:14 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-12-2018, 06:51 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-12-2018, 08:15 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-12-2018, 09:35 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-12-2018, 09:42 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-12-2018, 09:57 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-12-2018, 10:05 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-12-2018, 10:14 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-12-2018, 10:30 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-12-2018, 10:48 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-12-2018, 11:05 AM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-12-2018, 11:36 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-12-2018, 11:56 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-12-2018, 05:33 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-12-2018, 10:51 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-16-2018, 09:00 PM
RE: ATmega168 7-Segmentni Display - by gorankg - 04-16-2018, 09:56 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-14-2018, 09:33 PM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-15-2018, 06:33 AM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-15-2018, 08:58 AM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-15-2018, 10:56 AM
RE: ATmega168 7-Segmentni Display - by vojinilic - 04-15-2018, 01:04 PM
RE: ATmega168 7-Segmentni Display - by mikikg - 04-15-2018, 01:51 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-16-2018, 10:02 PM
RE: ATmega168 7-Segmentni Display - by ronovar - 04-17-2018, 11:42 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)