כח. מִקְצֵה | שָׁלשׁ שָׁנִים תּוֹצִיא אֶת כָּל מַעְשַׂר תְּבוּאָתְךָ בַּשָּׁנָה הַהִוא וְהִנַּחְתָּ בִּשְׁעָרֶיךָ׃
"At the end of three years, you shall take out all the tithe of your crop in that year and place it in your cities."
לֹא תוּכַל לֶאֱכֹל בִּשְׁעָרֶיךָ מַעְשַׂר דְּגָנְךָ וְתִירשְׁךָ וְיִצְהָרֶךָ וּבְכֹרֹת בְּקָרְךָ וְצֹאנֶךָ וְכָל נְדָרֶיךָ אֲשֶׁר תִּדֹּר וְנִדְבֹתֶיךָ וּתְרוּמַת יָדֶךָ׃
י אִם לִפְנֵי יְהֹוָה אֱלֹהֶיךָ תֹּאכְלֶנּוּ בַּמָּקוֹם אֲשֶׁר יִבְחַר יְהֹוָה אֱלֹהֶיךָ בּוֹ אַתָּה וּבִנְךָ וּבִתֶּךָ וְעַבְדְּךָ וַאֲמָתֶךָ וְהַלֵּוִי אֲשֶׁר בִּשְׁעָרֶיךָ וְשָׂמַחְתָּ לִפְנֵי יְהֹוָה אֱלֹהֶיךָ בְּכֹל מִשְׁלַח יָדֶךָ׃
You may not eat within your cities the tithe of your grain, or of your wine, or of your oil, or the firstborn of your cattle or of your sheep, or any of your vows that you will vow, or your donations, or the separation by your hand. But you shall eat them before the Lord, your God, in the place the Lord, your God, will choose you, your son, your daughter, your manservant, your maidservant, and the Levite who is in your cities, and you shall rejoice before the Lord, your God, in all your endeavors.
Rashi says, [You may not eat within your gates…] the firstborn of your cattle: This prohibition is addressed to the kohanim [in contrast to “the tithe of your grain,” since Israelites were never permitted to eat the firstborn, even within the walls of Jerusalem]. - however (and I may be mistaken), the context seems to have laws applying to everyone equally.
וְאֶל הַלְוִיִּם תְּדַבֵּר וְאָמַרְתָּ אֲלֵהֶם כִּי תִקְחוּ מֵאֵת בְּנֵי יִשְׂרָאֵל אֶת הַמַּעֲשֵׂר אֲשֶׁר נָתַתִּי לָכֶם מֵאִתָּם בְּנַחֲלַתְכֶם וַהֲרֵמֹתֶם מִמֶּנּוּ תְּרוּמַת יְהֹוָה מַעֲשֵׂר מִן הַמַּעֲשֵׂר׃
Speak to the Levites and tell them, "When you take the tithe from the children of Israel which I have given you from them as your inheritance, you shall set aside from it a gift for the Lord, a tithe of the tithe.
Question: Three different passages seem to be speaking of three different "kinds" of ma'aser with three different purposes. Does the Torah command to give 20% yearly and 30% every third year, or are some of these these laws the same, or have I misunderstood completely?