Do you know how large your power supply is?
I get this if I hook up too much stuff to my keyboard (it has built in 2 port usb hub). I only have the mouse plugged into that now. But if I plug something that needs a bunch of power, like my flash drive or digital camera, every minute or so the keyboard will power down and reset itself. It did that more often on my old computer which was only a 200watt PSU. The new computer is a 450watt PSU and the keyboard only powers down if I have something that requires a bunch of power in both usb ports, not just one (like the headphones and flash drive). Of course now all my USB ports are filled with something (not like when I first got my usb keyboard with the old computer). So I am drawing a lot of power out of all the ports. (Printer, joystick, gamepad, keyboard/mouse, flash drive, digital camera cord, gps data cord, headphones...)
So if I wanted to use the ports on my keyboard I'd have to hang a powered usb hub off those ports first so whatever is connected gets enough power.