I'm using a 16x2 LCD for a project on STM32F030R8. I wrote a library for interfacing and everything was working fine until recently. It displays garbled junk values in between operations, especially when I press a button and it has to change DRAM contents. It somehow started when my code size grew a lot or when I increased the MCU clock to 48 MHz. So far I'm clueless about what's causing this. It displays wrong characters on initialization after power down too.
EDIT: On my board, there is an interrupt service to update seven segment displays every 10 ms. Turning that off solves the problem. It might be that the interrupt is getting called in between LCD updates. Any idea how to solve this?