Microcontroller › 8051 › 16*2 LCD displaying black boxes while interfacing with 8051 › have you connected pot on pin
have you connected pot on pin number 3 of LCD?
if no then connect it
if yes then vary it to change brightness
ur program seems to be correct
but you can test it on proteus simulator