Discussion Forum

External memory on a XC16x Board

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Dennis Ebben
Posted
15-Jul-2003 13:17 GMT
Toolset
C166
New! External memory on a XC16x Board
Hi Everybody,

I'm still experimenting with Infineon's XC161 Starter Kit using the Keil C166 compiler, v4.27 (linker version 4.28). Almost everything I need works OK now, except the external bus controller. Below I'll describe my situation:

Hardware
========

I've connected the RAM to the processor by setting switch S101.8. This is the configuration for the multiplexed mode, so I also switched S103.1 and S103.2 off for 16 bits multiplexed mode.

The CS-lines are enabled by off-switching S102.6 and S102.7. I use 4-bit address lines by setting S102.4 and S102.5.

S102.8 is switched on to use /WR and /BHE as /WRL and /WRH.


Software
========

In the startup file (START_V2.A66) I configured the EBC as follows:


$SET (CONFIG_EBC = 1)
_SAPEN      EQU    4
_CSPEN      EQU    5
_ARBEN      EQU    0
_SLAVE      EQU    0
_EBCDIS     EQU    0
_WRCFG      EQU    1
_BYTDIS     EQU    0
_ALEDIS     EQU    0
_RDYDIS     EQU    0
_RDYPOL     EQU    0
_APDIS      EQU    0
_DHPDIS     EQU    0


CS1 as follows:


$SET (CONFIG_CS1 = 1)
_ADDR1      EQU    0x400000
_SIZE1      EQU    256*KB
_ENCS1      EQU    1
_RDYEN1     EQU    0
_RDYMOD1    EQU    0
_BTYP1      EQU    3
_PHA1       EQU    3
_PHB1       EQU    1
_PHC1       EQU    3
_PHD1       EQU    1
_PHE1       EQU    25
_RDPHF1     EQU    3
_WRPHF1     EQU    3


Maximum bus times to control the RAM, so it isn't a timing problem. In the target options (under 'External Memory") I set the following values for #1:

Start: 0x400000
Size : 0x40000

In my C-code I also set the P6 pins to output.

I've looked over my problem several times but couldn't trace the things going wrong. I also tried other memory configurations (8 bit mux, 8 bit demux and 16 bit demux) but all of them with no success.

Final thing to tell about are the contents of my .M66-file. All data is located in valid areas (I can see vars in the 0x400000 area), but one line is very strange:


  VALUE       PUBLIC SYMBOL NAME               REP   TGR  CLASS   SECTION
=======================================================================
-- cut --
  3F8000H     ?C_NDATABASE                     CONST ---  ---     ---
-- cut --


I don't know if 0x3F8000 should be an address, that is used somewhere else, but IF so, then it's not valid. I didn't configure this value anywhere; it's generated by Keil's Linker.

Well, phiew, that was a lot of writing, so I hope somebody can help me? :)

Kind Regards,
Dennis Ebben
Read-Only
Author
Dennis Ebben
Posted
17-Jul-2003 13:58 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi again,

Replying to my own message to get it on top of the thread list. ;)

Yesterday I succeeded in controlling the RAM by using CS0 (in 16 bit demux mode). Off course this works, because CS0 is the default Chip Select and will always be used by the controller when I write to/read from an undefined memory area. Don't know if the other CS's work.

On /CS2 I connected an LCD. Didn't get it working already, but that could be a software problem. (I can see a toggling signal on /CS2, as well as on /WR and /RD).

Doesn't really anybody know what the weird NDATA-value stands for, I mentioned in my previous post? (see bottom).

Kind Regards,
Dennis Ebben
Read-Only
Author
Stefan Fricke
Posted
18-Jul-2003 06:24 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

yes you can only connect CS0 and CS1 at the starter kit board. And CS1 may be, depending on your board version.
This because the older versions were shiped out with FLASH and SRAM as external memory. Newer versions come only with SRAM and are connected by default to CS0.
All other setting are irrelevant, without hardware modifying (since the CS lines are wired in parallele way .
On the other side there is a nice SPI-EEPROM at the solder side, which not many peoples have recogniced. I wrote little bit code for it to read from and write to it.

SRAM is working in 16-bit demuxed mode allways (FLASH versions to) and you have set the
external RAM (Options for Target)
0x10000 Size=0x20000.
I wrote a short code too, to test the SRAM.

I have documentation for the board, if you not found on your starter CD-ROM.

Concerning the NDATA question I can not answer without have a look at your C-code and the MAP-file.
It is in linker/locators responsibility, where the code would be located.
It depends from your memory modell.
May be the DPP's are changed or the segment pointer is modified.
The most simple way I think is to force the locator to lay it in a memory area, which really is in use.
For more information I need some details more.

Stefan
Read-Only
Author
Dennis Ebben
Posted
18-Jul-2003 08:38 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

Thanks for your response.

On the board I can see the following text: "XC16Board REV 200". This board is shipped without flash. There is an ability to place the flash components anyway.

A few days ago, I also set my memory settings to [start: 0x10000] and [size: 0x40000]. After that, the board started correctly and everything seems to work OK. This morning I write some vars to the RAM and the returning value also seems to be OK. So I think it works. But it's still weird, I only succeeded doing this on /CS0 and not on /CS1.

Why did you mention the SPI-EEPROM? Any special reason?
Talking about EEPROM's: I'm using FRAM's from Ramtron (FM24C256). Used them before and very satisfied with them.
If you don't know them: They are pin-compatible with 24xxx-EEPROM's, controlled by an I2C-bus, and can be written/read as much as you like. :)

Does the RAM only work in 16 bits demux?? I thought the board could work in all 4 modes. When I look to the wiring in the schematics of the board, I would say this shouldn't be a problem. My board was shipped with a CD-ROM and I do have the schematics and also a Hardware Manual.

I don't know what it is with the weird NDATA-values, but they appear everytime I configure external RAM. If I don't configure external RAM, the values is 004000H. I think that's also an undefined area, cause it isn't in internal processor RAM.

Here's a dump of the weird value when I DO configure external RAM:

      C00000H     ?C_NCONSTBASE                    CONST ---  ---     ---
      0000C0H     ?C_NCONSTBASESEG                 CONST ---  ---     ---
      008000H     ?C_NDATABASE                     CONST ---  ---     ---
      000000H     ?C_NDATABASESEG                  CONST ---  ---     ---

"?C_NDATABASE" has value 008000H now. That's outside my RAM-area, which starts at 0x10000. When I configure the RAM to 0x400000 (instead of 0x10000) "?C_NDATABASE" has the value 3F8000H. It's always: [start-address] – 0x8000. That's very strange, because that's almost always an undefined area.

Fortunately "?C_NDATABASE" isn't used anywhere (as far as I can see). So I don't care about the weird value anymore.

Kind Regards,
Dennis Ebben
Read-Only
Author
Stefan Fricke
Posted
18-Jul-2003 10:15 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

there was no special reason for the SPI_EEPROM, but I have metioned it, because, with only RAM and one LED on the board you have not so many options to "start up".
Now I use external hardware too.

The boards as shipped out are working with
16 bit demultiplexed bus.
CS0 is wired to the SRAM and CS1 to the (optional)FLASH.


C00000H     ?C_NCONSTBASE    CONST ---  ---
0000C0H     ?C_NCONSTBASESEG CONST ---  ---
008000H     ?C_NDATABASE     CONST ---  ---
000000H     ?C_NDATABASESEG  CONST ---  ---

This all are internal variables from the linker.
?C_NCONSTBASE address for calculating and linking locating is in this case C00000, each step this will increased to show you correct lines, addresses and so on.

?C_NCONSTBASESEG is the value for the base code segment
in your case it is C0
- you find it in C0'0000h (C0 is the segment pointer)
?C_NDATBASESEG is 000000 what means it shows to segment 00'0000 which is the systemsegment, where you find the internal RAM (with DATA's) and the sfr's.
The DATABASE I do not know , what could it mean exactly, but it is used for calculating something with datas.
But definitly you have not to take care for it, since these are internals.

(Thanks for your memory hint!)

Stefan
Read-Only
Author
Stefan Fricke
Posted
18-Jul-2003 10:50 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

me again.
I found out what the ?C_NDATABASE means.
Have a look at system manual on memory organization and find in segment 0 that the
area from 0x0000 to 0x8000 is external memory area.
0x8000 is a base adresse for calculating addresses of internal RAM and SFR for linker MAP file.

Stefan
Read-Only
Author
Dennis Ebben
Posted
21-Jul-2003 08:27 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

Yes, you're right about the starter kit. The kits that have been made in the past (by Phytec) all had more I/O on board, like I2C-components, more LED's, etc. I'm missing these things on this board. It's indeed not easy starting up, this way.

I had looked in the system manual already and saw the area you mentioned. But that still doesn't explain the 3F'8000 value for ?C_NDATBASESEG in some cases, because there's nothing on that address. No memory, no I/O. Don't know why Keil creates this value. Because my software works OK, in spite of these values, I've decided to ignore them.

Stefan, thanks again (second time now) for all your help and time. Things are clear to me again. :)

Kind regards,
Dennis
Read-Only
Author
Stefan Fricke
Posted
21-Jul-2003 12:58 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

thanks for this, but no matter.
OK I found out what is the meaning of
?C_NDATABASE and ?C_NDATABASESEG.

I configured my program as yours regarding the hardware.
For the following it can be usefull to have a look to system user manual section 4.5. Data adressing.

As you know the code is accessed by segments
( a 64kBytes each ) and data memory with pages ( a 16k each ).
So you have for pages per segment.
First you should ensur that your
?C_PAGEDPPx are the following values:
000000H         ?C_PAGEDPP0
000301H         ?C_PAGEDPP1
000100H         ?C_PAGEDPP2
I try to explain here:

3F'8000h is
0011 1111 1000 0000 0000 0000
where       00 0000 0000 0000 is Page offset
                              (14-bit)
          10                  selects DPP2
in DPP2 you find value 100    (10-bit)
01 0000 0000
now we will assemble the real address
(it results in 10-bit DDP2 value and 14-bit
 page offset)

0100 0000 0000 0000 0000 0000 ( 24 - bit )
in
HEX it is 40'0000h your NDATA area in RAM !

Thats where the DPP2 points by default after startup.
Let's do for DPP1 (301h)

11 0000 0000 ( 10-bit )

   01 00 0000 0000 0000
   01 is DPP1
      00 0000 0000 0000  is Page offset.
for Segment : Offset
    8-bit   : 16-bit
  1100 0000 : 0100 0000 0000 0000
   C    0      4    0    0    0
   C0'4000

the DPP1 points to you MAIN routine, you
find in map file as
C04000h    ......   ?NC?MAIN.
OK, how to calculate the obscourious
startaddress ?
40'0000h is your selected address for RAM.
DPP0 0-16K
DPP1 16-32K
DPP2 32-48K
DPP3 48-64k ( in each segment ).

Easy subtract 32k ( 8000h ) for DPP2 from
40'0000h and you get 3F'8000h.

DPP0 theoretical (really points to segment0)
3F'8000h - 3F'C000h
DPP1 theoretical (really poinst to C0'4000h)
3F'C000h - 40'0000h
DPP2
40'0000h - 40'4000
....

Best regards
Stefan
Read-Only
Author
Dennis Ebben
Posted
23-Jul-2003 08:21 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

I never really understood the DPP's. I think that it's really clear now (also to other readers of this thread). Thanks again. :)

What version of the datasheets do you use?? You mentioned chapter 4.5 (which is correct in version v1.1, feb 2002). Since the release of that manual there have been released 2 new versions:

* v2.0, 3-2003
* v2.1, 6-2003

The last one is the one I use now. In this version it's chapter 4.7 that handles about data addressing.

There are still some things that cannot be found in the new manuals, like the ADC-bug that's also known from the XC164 (ADBSY is set after x clock cycles, not immediately after starting an ADC-conversion).

Kind Regards,
Dennis
Read-Only
Author
Stefan Fricke
Posted
23-Jul-2003 09:06 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

cool that you understand now the DPP's.
It is really not complicated.
I need at my start two times and than I calculated three examples and now I have it.
( If questions concerning to this, do not hesitate to ask me )

I used the XC167 manual for this, since the register mappings are similar.
So if you write a program for a module, which is available on the other XC16x too,
you can be sure in 98% of cases it will run there.
So at XC161 the CAPCOM6 will not work and at
XC164 the I2C module.

Bugs, problems and workaround (if any) you can find in the errata sheets.
Please have additional a look of the step code of your device.

But you are right with the manuals specially for XC161.
There in the new version is the complete description of SCU missing.
I reported to Infineon and it will be updated with next release.

Stefan
Read-Only
Author
Dennis Ebben
Posted
24-Jul-2003 09:18 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

I know that the other XC16x devices are almost the same, but it's weird that there isn't any link on the site on the XC161 page to errata sheets of the other (similar) devices.

Also the starter kit isn't described on the Infineon site. The info about this controller and applications are really poor. But perhaps this will change in the future, for it's a new controller.

Does Infineon also have a forum, like Keil? If so, maybe we can discuss this there. :)

Kind Regards,
Dennis
Read-Only
Author
Stefan Fricke
Posted
24-Jul-2003 12:39 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

Infineon unfortunately has no discussion forum, so we have to discuss here, or we can do it by mail.
The kit indeed is only described at the
CD-ROM you find at the kit.

But I wonder, that the eratas are not on the web, since I got them from there.

I can mail you the last I have, if you are interested.

Stefan
Read-Only
Author
Dennis Ebben
Posted
24-Jul-2003 12:55 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

I've only found XC164 and XC167 errata sheets. No XC161. Searched for them again a few minutes ago, but still couldn't find them. :S

Kind Regards,
Dennis
Read-Only
Author
Stefan Fricke
Posted
24-Jul-2003 13:25 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

I send you my Erratas concerning Xc161CJ
step AA,AB and AC.

Please check your account.

Stefan
Read-Only
Author
Dennis Ebben
Posted
24-Jul-2003 14:07 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

I received your mail with errata sheets. I really can NOT find them on Infineon's site. Even when I log in to My Infineon I still can't find them.

Seems like you have more permissions to view/download files than I have. :)

Thanks a lot for de documents. I'll read them tomorrow morning.

Kind Regards,
Dennis
Read-Only
Author
Stefan Fricke
Posted
24-Jul-2003 15:42 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

it is not your mistake. At the moment there are really no erratas available for XC161CJ.
I got them some time before and save them all for such times. ;-}

Stefan
Read-Only
Author
Stefan Fricke
Posted
28-Jul-2003 06:20 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

I did a mistake.
The board works with 16-bit muxed bus.
Not demuxed.

Sorry for this,
Stefan
Read-Only
Author
Steffen Niekler
Posted
6-Aug-2003 15:33 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hello Stefan,
I've red the thread very carefully, but at the moment I'm a little bit confused about the right configurations for accessing the external RAM.
I've an XC164 Starterkit, Rev. 200 without FLASH and I got the RAM not working yet. Do you have an working configuration and because everything depends from everything, I need the DIP Switch configuration, the right settings in Start_A2.a66, the Target configuration and if I have something to code in main(),like special PORT configuration, it was also interesting, to get it.
Thank you very much in advance
Steffen
Read-Only
Author
Stefan Fricke
Posted
6-Aug-2003 16:04 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Steffen,

Board Settings
------------------------
| JUMPERSETTINGS |
------------------------
Jumper 401 ( 1-2 ) ON
Jumper 402 ( 1-2 ) ON
Jumper 501 ( 1-2 ) ON

------------------------
| DIPSWITCH - SETTING's |
------------------------
DIP102:
=======
1-3
Clock-Configuration: ON OFF ON Fin = 8 - 12 MHz
4-5
SALSEL: OFF OFF
2 Bit Segmentadresslines A17 ... A16
6-7
CSEL: ON OFF 2 CS - Lines
8
WRC: OFF /WR and /BHE work as /WR and /BHE
=============================================
SUM: ON OFF ON OFF OFF ON OFF OFF 10100100
=============================================

DIP103:
=======
1-2
Bus-Konfiguration: OFF OFF 16 Bit databus - multiplexed
3-6
Startup Mode: OFF OFF OFF OFF Standart Start
7
Adaptermode: OFF Standartoperation
8
ROC: OFF /RSTOUT remains LOW until
deactivation by USER-software
=============================================
SUM: OFF OFF OFF OFF OFF OFF OFF OFF 00000000
=============================================

DIP101:
=======
1-8
external memory configuration
OFF OFF OFF OFF OFF ON ON OFF
/CS0 = ext. RAM
/CS1 = ext. FLASH (not usefull)=============================================
SUM: OFF OFF OFF OFF OFF ON ON OFF 00000110
=============================================

DIP104/105:
===========
These settings depend from the selected segment address lines. For two bit lines
SALSEL = OFF OFF ( 2 Bit A17 ... A16 )
set DIP-switches as follows:
=============================================
DIP104: ON ON OFF OFF OFF OFF OFF OFF 11000000
DIP105: OFF OFF ON ON ON ON ON ON 00111111
( allways mirrored )
=============================================

DIP106:
=======
1-4
OFF OFF OFF OFF 0000 Normal program execution
ON OFF OFF OFF 1000 bootstraploader mode for programming
the micro e.g. with memtool


DIP104:
=======
1 2 3 4
Enable/Disable Peripherie
| | | |
nc nc CAN1 CAN2
for XC164
enable = ON disable = OFF
J1850
for XC161

Set as you need

Startup file I generated with DAvE.
You should enable the EBC and
set the phases for CS0 (RAM)timing to:
phase a: 0
phase b: 1
phase c: 1
phase d: 0
phase e: 1
phase f: 1 read
phase f: 0 write

Than no special port settings are required.
( I setup the data/ address port with DAvE too, so it stands in startup file)

Hope this helps, otherwise leave a message here and I will answer asap.
(But tomorrow ;-} )

Stefan
Read-Only
Author
Steffen Niekler
Posted
7-Aug-2003 10:54 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,
thank you for all the information, it works fine.
Based on this, I'll try to get the board working with demultiplexed memory access.
Do you think, there are some speed differences between multiplexed and demultiplexed memory access?
Best regards
Steffen
Read-Only
Author
Stefan Fricke
Posted
7-Aug-2003 11:10 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Steffen,

no matter about this. I do not know, whether the layout gives the possibility to work in demultiplexed mode.
But if you got it, it would be nice to have a short info about it.

Speed differences:

Yes there are some, since you have not to need latching the addresses.
But since the memory need some cycles per phase, it may be possible that you have to delay the phases in demuxed access mode.
So I can not exactly determine, if this would be a really improvement of the time.

Stefan
Read-Only
Author
Dennis Ebben
Posted
11-Aug-2003 09:16 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

I haven't been here for 2 weeks, because of my holidays. That's the reason I haven't replied since [7/24/03 8:07:42]. Now I'm back, so here is my reply: :)

I'm using the board in 16-bit demux. This works fine (didn't try 16-bit mux). I just switched the dip switches to the right configuration and changed the CS0-settings in the startup file.

Kind Regards,
Dennis Ebben
Read-Only
Author
Stefan Fricke
Posted
11-Aug-2003 09:24 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

thanks for feedback, that will be interested to Steffen too.
I never tried the demuxed mode.
So I do a test !

I am really thought, that only mux-mode was possible. :-{

If both modes works, this would be great.

Stefan.

Hi Steffen do you have any results with this ?
Read-Only
Author
Dennis Ebben
Posted
11-Aug-2003 09:37 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,

My board has been shipped with 2 external RAM's. One is routed in mux-mode and one in demux-mode. Depending on the dip-switches one of the two is selected.

Works fine here. :)

Kind regards,
Dennis
Read-Only
Author
Stefan Fricke
Posted
11-Aug-2003 09:46 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Dennis,

thanks again man.
For the future I should give more attention to the schematics ;-}

Stefan
It is clear now !!
Read-Only
Author
Steffen Niekler
Posted
11-Aug-2003 10:41 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hello Stefan and Dennis,
I've got the demuxed memory working, but I feel, there are some timing problems. In my configuration the XC164 is running with 40MHz and I use the memory allocation functions. Sometimes malloc returns a NULL pointer and the memory pool is definitivly not empty, because it is the first call after RESET and init_mempool. With multiplexed memory, I hav'nt seen this problem.
I use the fast settings from Stefan:
phase a: 0
phase b: 1
phase c: 1
phase d: 0
phase e: 1
phase f: 1 read
phase f: 0 write
and I also tried some slower values, with same result.
Another effect is, that UV2 is crashing down and the ULINK interface shows RUN.
But maybe it is a temperature problem, it is too hot in Germany at the moment ;-).
... the last 10 times it works, but it's not colder ???

Another problem, I have, is the second serial port from XC164. Everywhere you can read, it is an option for this device, but nowhere I've found a derivative with this option. Has anybody information about this.
Stefan, you have mentioned the serial EEPROM on the board and your code. Is it possible, to reuse it?
Thanks and bye
Steffen
Read-Only
Author
Stefan Fricke
Posted
11-Aug-2003 11:37 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Steffen,

no idea about what goes wrong with the timings, if Dennis not could help you with his experiences I would e-mail my project files for muxed mode ( and so my timings ).
Please leave your mail-account here.

I send my SPI-Routines to you, which works
with a terminal program via ASC0


Second ASC interface

You can freely use the second ASC interface.
The ASC1 is implemented now with all newer derivatives, since Infineon recognized that a second micro line is more daerer than test the second interface on each chip.
The best way is to develop the ASC routines with DAvE for XC161 and than copy the related routines to your project, since
the DAvE DIP does not included the second
ASC at this time.
Otherwise you can copy the ASC0 files to ASC1 files, but you have to dadapted the
MAIN.H with the addresses of ASC1 interface.

Take care to enable the ASC1 device in startup-file. This is one thing that DAvE does wrong !!

Stefan
Read-Only
Author
Steffen Niekler
Posted
11-Aug-2003 13:59 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,
I've got the ASC1 not running on my XC164 SK. I've tried your proposals and the software works fine in simulator with settings for XC161.
I've also measured some signals on MAX232 with oszi. I've seen the transmit datas (T1 IN and T1 OUT in schematics) for configuration ASC0 , but nothing, if I'll use ASC1 (T2 IN, T2 OUT).
So I have to assume, that ASC1 is not available on my XC164 or on my derivative, may be it's production step dependend.
My eMail account is
Steffen.Niekler@gmx.de
Bye Steffen
Read-Only
Author
Stefan Fricke
Posted
11-Aug-2003 14:55 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Steffen,

please check your account. I e-mailed the files.

Stefan
Read-Only
Author
Steffen Niekler
Posted
12-Aug-2003 06:51 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Stefan,
thank you for the code, at the moment I could'nt read it, because our mail server is down.
But I got the second serial interface running. The problem were the right port and alternate settings of ASC1.
I used the code for XC161, and there are some differences to XC164, because of lower pin count.
The solution is:
    P3  |= 0x0020;        /* SET PORT 3.5 OUTPUT LATCH (TXD1)               */
    DP3 |= 0x0020;        /* SET PORT 3.5 DIRECTION CONTROL (TXD1 OUTPUT)   */
    DP3 &= 0xFFFD;        /* RESET PORT 3.1 DIRECTION CONTROL (RXD1 INPUT)  */
    ASC1_TIC = 0x80;      /* SET TRANSMIT INTERRUPT FLAG                   */
    ASC1_RIC = 0x00;      /* DELETE RECEIVE INTERRUPT FLAG                 */
    ASC1_BG  = 0x20;      /* SET BAUDRATE TO 38400 BAUD @ 40MHz             */
    ASC1_CON = 0x8011;    /* SET SERIAL MODE                               */
    ALTSEL0P3 |= 0x0022;  /* Configure port pins for serial interface 1    */
Read-Only
Author
Stefan Fricke
Posted
12-Aug-2003 06:58 GMT
Toolset
C166
New! RE: External memory on a XC16x Board
Hi Steffen,

well done job! ;-}
As I mentioned I got it too some times before.
But now you can sure to use your code allways with the new devices.
If some questions about my code samples, feel free to contact me.

Stefan

Next Thread | Thread List | Previous Thread Start a Thread | Settings