BradleyC
Active member
I confess to being a noob with Arduino/Teensyduino - not a noob to embedded development or Cortex M, however.
Should it be possible to read any UART1 register and display it with code similar to that shown below that attempts to read the UART_BDH register?
On the register access, the sketch appears to hang.
No further progress through the routines called from Setup() seems to occur judging from the expected progress displays sent to Serial.print(). (I have not put the OScope on pins)
While the "going to read a UART register now." appears on Serial console, the message "read the value ok." never appears.
The program appears to behave as if a machine check or memory protection trap has occurred with a the trap handler that executes a 'jump here' loop.
Should it be possible to read any UART1 register and display it with code similar to that shown below that attempts to read the UART_BDH register?
On the register access, the sketch appears to hang.
No further progress through the routines called from Setup() seems to occur judging from the expected progress displays sent to Serial.print(). (I have not put the OScope on pins)
Code:
#define MAX483CTL 9 // Pin 9 controls MAX483 direction. LOW enables Reception, HIGH, transmission
void setupComms( void ) {
uint8_t rval;
// the existing RS-485 system runs at 19200.
Serial.println("setupComms() - Serial1");
Serial1.begin( 19200 );
Serial1.transmitterEnable( MAX483CTL ); // Pin 9 controls MAX483 direction. LOW enables Reception, HIGH, transmission
delay(500);
Serial.println("going to read a UART register now.");
rval = *((uint8_t *)0x4006B000);
Serial.println("read the value ok."); // FIXME - code never reaches here.
Serial.print("Contents of UART1_BDH was: "); Serial.println(rval, HEX);
return;
}
While the "going to read a UART register now." appears on Serial console, the message "read the value ok." never appears.
The program appears to behave as if a machine check or memory protection trap has occurred with a the trap handler that executes a 'jump here' loop.