Heat 3 inches of oil in large pot to 375°F.
Whisk together cornmeal, flour, baking powder, baking soda, salt, pepper, garlic powder, and cayenne.
In separate bowl, whisk buttermilk, egg, and sugar.
Pour wet into dry. Stir just until combined. Do not overmix.
Fold in diced onion.
Let batter rest 5 minutes.
Check oil is at 375°F.
Drop rounded tablespoons of batter into oil. Fry 5 to 6 at a time.
Fry 2 to 3 minutes until golden on bottom. Flip.
Fry 2 to 3 more minutes until golden all over.
Remove with slotted spoon. Drain on paper towels.
Repeat with remaining batter.
Serve hot.