Astrophotography free software download for Nikon?

Is there a free astrophotography software that works with Nikon cameras (esp. Nikon D40x) ?

Why would you need special software? Just use the manual settings on the camera.

Unfortunately, Nikon is not known for its "openess" for camera control software by third party developers.
http://www.astropix.com/HTML/I_ASTROP/NIK_CAN.HTM
http://www.thephotoforum.com/forum/digital-discussion-q/179200-time-lapse-bulb-mode-long-intervals-nikon-d40x.html
From what I'm seeing from searching, D40x does not have an accessory port for an external timer or computer control. So it is limited to a maximum of 30 seconds.
You might want to find a D40x forum and ask.there.
Alternatively, look into getting something like a Canon XTi, which is widely supported by 3rd party software and hardware.
http://www.stark-labs.com/nebulosity.html
http://www.amazon.com/...B003Q9RERY
http://www.msb-astroart.com/ccd_en.htm
Or, go with a low to mid - range dedicated astro camera -
http://www.telescope.com/...hy-cameras