Charge trapping diodes