Rinse the split peas in cold water, then tip them into a pan with the halved onion, stock cube and enough water to cover by about 4 cm. Bring to the boil and skim off any foam.
Simmer gently for 45 to 55 minutes until the peas are completely soft and most of the water has been absorbed, topping up with a splash of hot water if the pan looks dry before the peas are done.
Fish out the onion halves, then beat the butter into the peas and season well with salt and plenty of black pepper. Mash or blend to a soft, spreadable puree. It should be thick enough to hold its shape on a spoon.
Split the stotties and spread the bottom halves thickly with the warm pease pudding. Layer over the ham and a grind more pepper, then sandwich with the tops.
Serve while the pease pudding is still warm. Any leftover pudding keeps in the fridge for up to 3 days and can be reheated with a splash of milk.