I speak Spanish as a foreign language. There, I am used to a few rules governing which syllables are stressed, and if a word somehow deviates, an explicit accent is used.
I'm learning (Brazilian) Portuguese right now, and things seem different. There are some rules, but there seem to be many exceptions, things seem kind of random to me at this point. For example, take these two words:
pede (3. person Presente) and pedi (1. person Pretérito Perfeito)
I learned that the stressed syllables (marked with capital letters) are PEde and peDI. But these words are almost identical: 4 letters, 2 syllables, both end with a vowel, no accents, and yet, one stresses the first syllable, the other stresses the second. In Spanish, the second word would need to be written 'pedí' for the last syllable to be the stressed one.
Does it have something to do with the tense? Are rules for verbs in the present and past tenses different? What about the other tenses? Would anybody have any helpful links with more information?
EDIT: This has already been answered below, but I've just recently found this video which explains the most basic rules (including words ending with 'i', among others): https://www.youtube.com/watch?v=SQH-Xv9i7aw&t=129s