2011 hyundai tucson = check engine light

check engine light goes on and off periodically  AND  it just started to almost stall when I turn AC on......any thoughts or suggestions on what the issue maybe before getting code reader tested

checked the gas cap and all seems ok, light still sporadically reflects "check engine"