I am in the process of initializing the registers in the TL16C752 UART with my Atmega2560 Processor. The problem I am having is:
- I write the register (LCR for example) with the settings I need.
- I can then turn around and read it correctly
- When I write the next register (DLL for instance) and turn around and read it, it is correct
- When I try to go back and read the LCR register it displays what I wrote to the DLL
The steps I am using for a Write are:
- Set Chip Select
- Set the Address Lines with GPIO Port Pins
- Select IOW / Deselect IOR
- Write the Data to D0-D7
The steps I am using for a Read are:
- Set Chip Select
- Set the Address Lines with GPIO Port Pins
- Select IOR /Deselect IOW
- Read the Data from D0-D7
I'm trying to accomplish this without writing and reading registers that need advanced access. i do have to set the LCR Divisor Latch Enable bit, After writing the DLL, I return the LCR back to it's original setting.
I'm following the steps in the data sheet section Typical Application
We are using an 18.432 MHz crystal for the clock so that I can get 115200 Baud.
Thanks for your help,
Reif Heck