How add user code in firmware?

edited April 2018 in Repetier-Firmware
Hello!
I try to use my printer (on Mega2560) with termocouples. Termocouples connected to I-7018 device, which i ask by DCON protocol and 485 interface.

I connect 485 to UART3 and Z_MAX pin (19) as RTS.

I use 1.0.0 Repetier, patch standart ARDUINO UART library to support 485 devices and add my own code to connect to I-7018

All work fine before i try homing printer. 
When i send G28 - all communication with I-7018 stoped. Homing ended - communication restored.

Firstly i insert call GetAI_I7018() in arduino main loop() - work fine, if printer stop. Not work if printer homing. All is stable.
Move call to EVENT_PERIODICAL - work, but when send G28 communication to I-7018 stop and printer is reboot an endstop is hit.

Where must i place my code?

Sorry for my bad english :)

Comments

  • G28 waits for the homing to finish, so does not run normal command loop until finished. If it is only reading temperature you whould do it like e.g. the spi driven thermocouple systems - read response on request in extruder.cpp when temperatures are requested.
  • edited April 2018
    Repetier said:
    G28 waits for the homing to finish, so does not run normal command loop until finished. If it is only reading temperature you whould do it like e.g. the spi driven thermocouple systems - read response on request in extruder.cpp when temperatures are requested.
    Ок, you mean  in Extruder::manageTemperatures() or in TemperatureController::updateCurrentTemperature() ?
    It called allways? When homing, printing, warming bed, etc?


  • Thank a lot!
    All work!

Sign In or Register to comment.