Hello, I am new to the 8051 architecture. A few questions: I found a general UART example FROM Keil and converted all registers to the C8051F020 architecture. It runs fine in the simulator with proper output to the Serial #1 debug window. I downloaded using the SiLabs plugin dll to the target board. Downloaded the code but no output on the uart 0. I am a bit confused. Found out tonight that this this thing called a XBAR needs to be configured. Weirdest thing I've ever seen before. Anyhow: 1) why does the simulator work and the actual target does not? 2) why can I configure peripherials in debug in the simulator and no matter what I do it works? I didn't know of a crossbar at this point. 3) SiLabs has a configuration utility to configure the crossbar and I can import that to Keil (if I make it under 'c' and not assembler because of duplicate includes probelems with the 'c' code I write in Keil). So what is the mechanism to make/adjust a new startup.a51 file? Or should I use the 'c' produced from the SiLabs config utility. 4) I have found the crossbar chart in the devices pdf file, but should I use SiLabs config utility, or is there a predefined procedure in Keil to configure the crossbar? Thanks very much in-advance for any assistance, C.
No there is no cross bar configuration in the Keil toolset. You have found the Configuration utility in the SiLabs tools. This will create a good template in C. You simply add the C code into your Keil project as an initialization routine. The Keil header files in the INC folder will define the SFRs and the sbit assignments. These will match the symbol names of the SFR and SBITs but you will need to modify some of the actual values to match your hardware configuration. But first you need to seriously review the SiLabs data sheet on the Cross Bar and the priority tree of the F020 device. The priority tree assigns which pins are to be your USART pins. Higher priority items such as SPI or Analog will push down the USART pins even to a different port. You must understand the cross bar assignments to use these devices. SiLabs has a number of App Notes on the Config utilities and cross bar assignements. This most confusing thing to me is the fact that there are TWO different configuration utilities. Make sure that you are using the earlier version for the F020 device. Also you will need to review the 8051 Bible. Just do a quick search on 'Bible' in this discussion forum and you will find many many entries and links to these documents. 1. The simulator works because it assumes a default configuration for the cross bar. This will be the SFR configuration as defined in the device data sheet for Power On reset defaults. 2. Your target does not match the device default configuration. 3. You might make changes in the startup.a51 for other reasons, but there are no changes required in the startup.a51 for configuring the cross bar. Remember, this is just an initialization of the device to your target requirements. 4. There are no predefined cross bar configurations in the Keil Tools. There are some examples in the SiLabs tools that use the Keil tools as the default tool set. Also you can download additional examples from the SiLabs website. Bradford