I can’t tell you if your register setup is correct. Why don’t you just use the attachedInterrupt() function?
I can tell you that your accessing of ‘val’ in loop() may not be atomic. Try this:
void loop() {
uint32_t localVal;
noInterrupts();
localVal = val;
interrupts();
Serial.println(localVal);
}
You might also want a delay in loop() to slow down the print rate.