A circular stapling device comprising: a handle assembly including a housing , a motor , and a transmission assembly , the housing defining a cavity , the motor supported within the cavity and having a drive shaft coupled to the transmission assembly, an elongate body having a proximal portion coupled to the handle assembly and a distal portion; a shell assembly supported on the distal portion of the elongate body, the shell assembly including a staple cartridge having an annular array of staples and a pusher ; and an anvil assembly ; wherein the transmission assembly includes a fire gear , a clamp gear , a sun gear and a planetary gear , the fire gear including an annular body having an internal gear surface and an external gear surface , the clamp gear including an external gear surface and at least one post that rotatably supports the planetary gear, wherein the drive shaft of the motor is coupled to the sun gear, the sun gear is engaged with the planetary gear, and the planetary gear is engaged with the internal gear surface of the fire gear; wherein the circular stapling device further includes a transfer switch assembly supported by the housing of the handle assembly, the transfer switch assembly being movable between a first position engaged with the fire gear to prevent rotation of the fire gear and a second position engaged with the clamp gear to prevent rotation of the clamp gear; wherein the anvil assembly is operably coupled to the clamp gear; and wherein the transmission assembly is configured such that activation of the motor with the transfer switch assembly in the first position causes movement of the anvil assembly in relation to the staple cartridge and activation of the motor with the transfer switch in the second position causes movement of the pusher in relation to the staple cartridge to eject staples from the staple cartridge. a handle assembly including a housing , a motor , and a transmission assembly , the housing defining a cavity , the motor supported within the cavity and having a drive shaft coupled to the transmission assembly, an elongate body having a proximal portion coupled to the handle assembly and a distal portion; a shell assembly supported on the distal portion of the elongate body, the shell assembly including a staple cartridge having an annular array of staples and a pusher ; and an anvil assembly ; wherein the transmission assembly includes a fire gear , a clamp gear , a sun gear and a planetary gear , the fire gear including an annular body having an internal gear surface and an external gear surface , the clamp gear including an external gear surface and at least one post that rotatably supports the planetary gear, wherein the drive shaft of the motor is coupled to the sun gear, the sun gear is engaged with the planetary gear, and the planetary gear is engaged with the internal gear surface of the fire gear; wherein the circular stapling device further includes a transfer switch assembly supported by the housing of the handle assembly, the transfer switch assembly being movable between a first position engaged with the fire gear to prevent rotation of the fire gear and a second position engaged with the clamp gear to prevent rotation of the clamp gear; wherein the anvil assembly is operably coupled to the clamp gear; and wherein the transmission assembly is configured such that activation of the motor with the transfer switch assembly in the first position causes movement of the anvil assembly in relation to the staple cartridge and activation of the motor with the transfer switch in the second position causes movement of the pusher in relation to the staple cartridge to eject staples from the staple cartridge. <EOS>