Morendil / simreprap

emulates en entire reprap 3D printer running a Marlin firmware binary, renders it in opengl
0 stars 0 forks source link

Z_ENABLE is dead (RAMPS 1.4 emulation) #1

Closed Morendil closed 9 years ago

Morendil commented 9 years ago

I've recently added pin mappings to complement the original mappings which were for mega644.

Pin 62, which is what Marlin maps Z_ENABLE to for RAMPS 1.4 boards, doesn't trigger the stepper_enable hook. On starting the emulator you can see the hook being triggered for X,Y,E but not Z.

Morendil commented 9 years ago

Pin 62 in the mega2560 is mapped to IO port K, which apparently sits in "extended IO space", at an address above 256 (0x100) in RAM. It's not clear that simavr supports this - sim_core.c, line 209, hard-codes 256 as the upper bound of IO space. Declarations such as that for _avr_set_r take the register address to be an 8-bit value.

Morendil commented 9 years ago

Fixed by c246d86a26af91aea9a52265d6648bd99104b5c8