A lamp ballast comprising: a DC-DC converter configured to convert a DC voltage into a variable DC voltage and output the same; an inverter configured to convert said DC voltage from the DC-DC converter at a varying frequency into an AC power, and providing said AC power to a lamp load; a starting circuit configured to receive said AC power to generate a high voltage pulse and provide it to said lamp load; a controller configured to control said DC-DC converter and said inverter to provide said variable DC voltage and said AC power of variable frequency; and a comparator configured to compare the DC voltage from said DC-DC converter with a predetermined threshold, wherein said controller has a starting mode of driving said inverter at a starting frequency to generate said high voltage pulse, and a lighting mode of driving the inverter at a frequency lower than said starting frequency, characterized by said controller having a detection mode of causing said DC-DC converter to provide a detection DC voltage prior to said starting mode, a discharge lamp lighting program of operating, after the detection mode, said inverter in said starting mode and subsequently in said lighting mode, and an incandescent lamp lighting program of operating, after the detection mode, said inverter in said lighting mode without through said starting mode, said comparator being configured to provide a first detection signal to said controller when said detection DC voltage exceeds said predetermined threshold, and provide a second detection signal when said detection DC voltage is lower than said predetermined threshold, and said controller being configured to select said discharge lamp lighting program in response to said first detection signal, and select said incandescent lamp lighting program in response to said second detection signal. a DC-DC converter configured to convert a DC voltage into a variable DC voltage and output the same; an inverter configured to convert said DC voltage from the DC-DC converter at a varying frequency into an AC power, and providing said AC power to a lamp load; a starting circuit configured to receive said AC power to generate a high voltage pulse and provide it to said lamp load; a controller configured to control said DC-DC converter and said inverter to provide said variable DC voltage and said AC power of variable frequency; and a comparator configured to compare the DC voltage from said DC-DC converter with a predetermined threshold, wherein said controller has a starting mode of driving said inverter at a starting frequency to generate said high voltage pulse, and a lighting mode of driving the inverter at a frequency lower than said starting frequency, characterized by said controller having a detection mode of causing said DC-DC converter to provide a detection DC voltage prior to said starting mode, a discharge lamp lighting program of operating, after the detection mode, said inverter in said starting mode and subsequently in said lighting mode, and an incandescent lamp lighting program of operating, after the detection mode, said inverter in said lighting mode without through said starting mode, said comparator being configured to provide a first detection signal to said controller when said detection DC voltage exceeds said predetermined threshold, and provide a second detection signal when said detection DC voltage is lower than said predetermined threshold, and said controller being configured to select said discharge lamp lighting program in response to said first detection signal, and select said incandescent lamp lighting program in response to said second detection signal.