Preheat the oven to 400 degrees . Grease a 9-by-13-inch baking dish. In a large bowl, whisk together the cornmeal, flour, sugar, baking powder and salt. In a separate large bowl, stir together the buttermilk, cheese, eggs and butter. Stir in the black-eyed peas and the chiles, if using.
Add the buttermilk mixture to the dry ingredients; using a fork, stir gently until just combined. Pour into the prepared baking dish and bake until golden-brown, about 25 minutes. Let stand for 20 minutes, then cut into 12 squares.