Microprocessors Laboratory - Exercises page

UFSC/LISHA - Author: Hugo Marcondes, Wolfram Stacklies and Thiago Leao Moreira

Eating some bugs ...

Bugs1

We found the bugs above:
  1. The file context.h has a space after last backslash.
  2. Enum definition of PORTS on file avr8.h has the wrong value. It was added the memaddress offset of 0x20, instructions in and out use direct IO port address.
  3. Enabling interrupts on SREG was the wrong value, the correct is 0x80
  4. On timer.h, the order of operands in out intruction was inverted
  5. ** On file handler.cc is missing the reti instruction on general impl. of vectors.
  6. On file my_handle.cc, the handlers of interruptions is calling ret instruction. The correct is reti.
  7. On file handler.h is missing the extern "C" statement for avoid C++ name mangling.
  8. On file system.cc the counter var is reseting on every interrupt handling.
  9. Must compile the interrupt functions with -fomit-frame-pointer
  10. The for loop on main.cc is not closed (cause the system be constantly reinitialized)
** This in fact is not a bug, since the vectors jumps to the __bad_interrupt function that has de reti instruction. The bug that was not discover (masked by this false bug =P ) is the comments on avr8.h file, but since the main program is using direct in/out instructions, this comments don't affect the execution of the program.

Bugs2

We found the bugs above:
  1. Watchdog timer was enabled, causing MCU reset constantly.
  2. Missing ; after main while infinity loop.
  3. Declaration of __vector_1 is missing on extern "C" statement ( __vector_0 is declared, but not used. )
  4. Wrong interruption vector declared to handle timer1 overflow. ( declared 5, must be 6 ).

Warning: Undefined array key "PATH_TRANSLATED" in /var/www/intranet/teaching/esl/ine5349-2004-1/work/g7/index.php on line 25

Warning: opendir(/bugs): Failed to open directory: No such file or directory in /var/www/intranet/teaching/esl/ine5349-2004-1/work/g7/index.php on line 26