We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello:
I am working on interfacing(connecting) the mini-Module 167 to dSpace system through RS-485. For this purpose I have to use the second serial port of the evaluation board of the mini-Module 167. The controller number is C167CR-LM.
Taking a reference what was mentioned in previous forum ( C166: USING 2ND SERIAL PORT (ASC1) ON INFINEON XC16X DEVICES, http://www.keil.com/support/docs/2601.htm). I modified the putcahr.c & getkey.c files in order to suit my controller settings and register names.
If I select (#define USE_ASC 0) every thing will go well, but if i select 1 to use the second port, the compiler will compile the code without any errors but no output on the simulator, even no output on the controller itself.
Please find my code below:
#include <reg167.h> #include <stdio.h> #define USE_ASC 1 void main (void) { #ifndef Monitor /* do not initialize if you use Monitor-166 */ #if (USE_ASC == 0) P3 |= 0x0400; /* set port 3.10 output latch (TXD) */ DP3 |= 0x0400; /* configure port 3.10 for output */ /* operation. ( TXD output) */ DP3 &= 0xF7FF; /* configure port 3.11 for input */ /* operation. ( RXD input) */ S0TIC = 0x80; /* set transmit interrupt flag */ S0RIC = 0x00; /* delete receive interrupt flag */ S0BG = 0x40; /* set baudrate to 9600 baud */ S0CON = 0x8011; /* set serial mode */ #else P3 |= 0x0200; /* 0x0200 SET PORT 3.0[3.9] OUTPUT LATCH (TXD) */ DP3 |= 0x0200; /* 0x0200 SET PORT 3.0 [3.9] DIRECTION CONTROL (TXD OUTPUT) */ DP3 &= 0xFEFF; /* 0xFEFF RESET PORT 3.1[3.8] DIRECTION CONTROL (RXD INPUT) */ SSCTIC = 0x80; /* SET TRANSMIT INTERRUPT FLAG */ SSCRIC = 0x00; /* DELETE RECEIVE INTERRUPT FLAG */ SSCBR = 0x0009; /* 0x0009 SET BAUDRATE TO 1MB BAUD @ 20MHz */ SSCCON = 0x8011; /* 0xC057 SET SERIAL MODE */ #endif #endif while (1) { printf("E\n"); } }
Of course I have included the modified putchar.c & getkey.c in my project. Also, in the simulator, I have assigned WIN2 to receive from SSCIN & SSCOUT, but still no output.
Would you please tell me what is wrong in my code.
Thank you in advance for your advise.
Best Regards,
Hello every body:
After checking what you advised me to do, I found that the version of the mini-module 167 whcich I am working on is very old (May 1999, PCB Version No. MM-Basis-1117.4)
So my knowledge and questions were based on the hardware manual of May 1999 version. And it seems you were talking about newer version, and this is the reason of misunderstanding and conflict.
There are big differences between the manual of 1999 and the one which Mr. Ulf Sass sent to me (August 2002 PCB revision #1216.0).
By the way, Mr. Ulf Sass, I ckecked the link you sent to me (www.phytec.de/.../minimodul-167_mm-310_.html Download this file: mm-167-scc2691-keil_extendedmodes.zip) and I could not download the ZIP file, I was directed to another webpage and eventhough there are some links are not downloadable.
What I can say about the 1999 version of the hardware manual that it is not comprehensive, and there are alot of mysterious issues.
As a conclusion, I am still confused and the picture is not clear to me.
Again, Thank you for your help and patiency.
Hello Hakam, I checked the link and it was ok. Then right click to the file name an save it to your PC. Hope this helps. Did yout try to contact PHYTEC?