The understanding of electrical properties of grain boundaries in perovskites is essential for their application to capacitors, varistors and positive-temperature coefficient resistors. The origin of the electrical activity is generally attributed to the existence of charged defects in grain boundaries, usually assumed to be impurities, which set up a double Schottky barrier as they are screened by dopants in the adjacent bulk crystal. Microscopic understanding of the origin of the grain boundary charge, however, has not been achieved. It is not known yet if the charged grain boundary states are an intrinsic property of a stoichiometric grain boundary, arise from nonstoichiometry, or are caused by impurities. Here, the relation between atomic structure and electronic properties is studied by combining experiment with ab-initio calculations. The starting structures for theoretical calculations were obtained from Z-contrast images combined with electron energy loss spectroscopy to resolve the dislocation core structures comprising the boundary. Dislocation core reconstructions are typical of all grain boundaries so far observed in this material. They avoid like-ion repulsion, and provide alternative sites for cation occupation in the grain boundaries. Optimized atomic positions are found by total energy calculations. Calculated differences in vacancy formation energies between the grain boundaries and the bulk suggest that vacancy segregation can account for the postulated grain boundary charge.