Chattering can be 'normal' or can be due to a physical illness. By 'normal' i mean a behavior
issue that can come about with stress or anxiety. A physical cause could be a neurological disorder (partial or focal seizures) or a problem with the teeth.
Stress and anxiety would something to rule in/out with an exam. If no abnormalities are found on the exam then this could be the cause. It's nothing that you can physically diagnose, but it would be the most likely cause if all other causes are ruled out.
Sometimes if a dog has dental
disease, a tooth fracture or any problem with the tooth under the gums they will chatter their teeth due to pain. It may not be enough pain to keep them from eating, they will just chew on the other side. If you start to notice that he is having trouble eating (dropping food) or is eating slowly and carefully this would indicate a problem with a tooth so you should get him seen.
A seizure disorder is hard to diagnose, especially if the physical exam and neurologic exam show no significant findings. This is sometimes the case without expensive testing and those tests may not even be diagnostic. It may help to try to touch him or talk to him during these chattering episodes to see if he responds to you and stops chattering. If he stops and responds this could mean he has control over the chattering and this could point to pain as a cause and not seizures.
If your dog doesn't seem to be bothered by it, you can just watch him and see if the episodes change (more severe or full onset seizure) or increase in frequency. It wouldn't be a bad idea to have your vet do a good exam with an oral exam and neurologic exam to see if there are any other physical signs that can point to where the problem is.
I hope this answer was helpful! If you have any further questions, do not hesitate to ask!