Let $K$ be a connected compact Lie group. The moduli space of flat $K$-connections over an $n$-torus is homeomorphic to the character variety $Hom(\mathbb{Z}^n,K)/K$.
The identity component of this space is homeomorphic to $T^n/W$ where $T$ is a maximal torus in $K$ and $W$ is the Weyl group (generalizing the example you gave when $K=SU(m)$).
Here are some examples for $K=SU(2)$:
$Hom(\mathbb{Z},K)/K=[-2,2]$
$Hom(\mathbb{Z}^3,K)/K$ is a 3-dimensional orbifold. Here is video of a continuous family of slices of it.
In general, the moduli space is connected iff $n=1$, or $n=2$ and $K$ is simply connected, or $n\geq 3$ and $K$ is isomorphic to a product of $SU(m)$'s and/or $Sp(k)$'s.
Replacing $K$ with a complex reductive group $G$, we have a similar, although more complicated story. Please see my paper: Topology of character varieties of Abelian groups (co-authored with C. Florentino) for details about that case (and references for the above mentioned facts).