Jump to content
ELFORUM - Forumul electronistilor

pb cu Atmega16


Guest Fanatikul

Recommended Posts

Guest Fanatikul

Nu stiu de ce pinii PC5...PC7 din PORTC nu sunt in stare sa scoata pulsuri (pt ENB la LCD). Pinii PC0..PC2 scot pulsuri fara pb, am vazut pe osciloscop, dar PC5..7 raman doar pe 1 logic, fara sa mai pulseze. E ceva legat de functiile alternative ale pinului ? Cum dezactivez functiile alternative ?

Link to comment
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • pisoiu

    3

Top Posters In This Topic

Guest Fanatikul

E ok, s-a rezolvat. In schimb, am alta pb acum: nu prea reusesc sa dezactivez JTD-ul din MCUCSR. Trebuie 2 scrieri in 4 cicluri. Singura instructiune care am reusit sa o folosesc este MCUCSR = 0x80 de 2 ori. Variantele MCUCSR |= 0x80 sau chiar MCUCSR |= _BV(JTD) sunt prea lente (5 cicluri sau mai mult) astfel ca nu ajung sa scrie de 2 ori in 4 cicluri. Aveti idee cum pot rezolva asta in C ? Pot folosi cumva instructiunea SBI din ASM in C ?

Link to comment

Auch....sorry, eu scriu totul in ASM. Secventa folosita de mine e:;REGISTER DEFINITION.DEF ACC=R22 ;DISABLE JTAG INTERFACE, SOME PINS ARE USED FROM IT LDI ACC,1<

Link to comment
Guest Fanatikul

OK, incerc sa ma descurc. Multumesc pt raspuns.Apropo de ASM, cu OUT setezi o valoare absoluta, sau faci OR ? ca din cate inteleg eu, tu scrii toate pozitiile registrului cu 0, doar JTD cu 1. Asta fac si eu in C, dar as vrea ceva rapid pt OR. Folosesti SBI si CBI ?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines