2006-02-07 08:02 PM
2006-01-25 09:50 PM
Hello everyone,
I'm having some problems with my ST7 : 1) the ST7 doesn't go in interruption when the TDRE bit is set. (I have enabled the interruptions with the 7th bit of SCICR2 set, and I also enabled global interruptions.) 2) My computer doesn't understand what the ST7 is sending via the MAX232 : the computer shows the integers 0 and 192 which doesn't match with the ASCII code of the char that I've sent. I hope someone can tell me where to look to understand these problems. Thank you Orlando. [ This message was edited by: Orlando on 26-01-2006 13:12 ]2006-01-25 10:10 PM
conserning your PC, could you check, if you have right settings of the PC (baud rate, number of stop bits, parity), and the same for ST7 (take into account that Fcpu is half of Fclk, and there are 3 prescalers for baud rate).
2006-01-25 10:41 PM
Hi.
According to my experience, i had problems due to the wrong baudrate computation. Try different baudrates on your PC with the same mc baudrate. And not all mc baudrates are serviced correctly by PC. Good luck2006-01-25 11:41 PM
Hello,
Thank you for answering so soon : The baud rate of my st7 is : 9600bps (SCIBRR = 0xD2), and I'm sending 8-bit datas . My computer has no parity bit and the baud rate is 9600 bauds. Are these good values? I'm also going to change my baud rate as you said. I'll tell you how it worked. Thanks Orlando2006-01-26 02:55 AM
if you have osciloskop, it is a best way to check real baudrate with it. I have made mistake in BR selection lot of time...
9600 is accepted by PC without problem.2006-01-26 08:47 PM
Thank you, but I do not have an oscilloscope.
I changed the baud rate of the st7, now the computer is receiving different datas but they still do not have the good values. When I made the circuit of the MAX232, I put 1.1µF capas instead of 1µF, do you think this could be a problem? Orlando [ This message was edited by: Orlando on 27-01-2006 10:18 ]2006-01-30 04:17 AM
Hello again,
I have tried everything : 7 data bits+parity+stop bit, 7data bits+stop bit, 8 data bits+parity+stop bit, 8 data bits+stop bit and none of them is working. I don't know what to do... The MAX232 I'm using is MAX232ECPE. Does anyone have any idea why I can't get this to work? (and don't say I am the problem... :D ) Here is a part of my main.c :Code:
<BR> for(i=0;i<10;i++) <BR> { <BR> if(_btst(SCISR,7)) <BR> { <BR> <BR> SCIDR='a'; <BR> <BR> } <BR> <BR> } <BR>
and here is how I define the com :Code:
<BR>void init_COM(void) <BR>{ <BR> _bset(PEDDR,0); // configures port E0 as output TDO <BR> _bset(PEOR,0); <BR> <BR> _bres(SCICR1,4); //8 bits by bytes <BR> _bres(SCICR1,3); //pas de mise en veille <BR> <BR> //_bset(SCICR2,7); //interrupt enable <BR> <BR> <BR> SCIBRR=0xD2; //4800 bauds <BR> <BR> <BR> _bset(SCICR2,3); //enable transmit <BR>} <BR>
Thanks Orlando[ This message was edited by: Orlando on 30-01-2006 21:23 ]2006-01-30 07:29 PM
Hi.
I am using ST7MC. I configure both TDO and RDI as input floating ports and without any interrupts. I am not sure whether it is valid for your mc as well. and one more suggestion. what kind of oscillator do u use? as for me, a found only few mc baudrate divider combinations which compatible with pc baudrates.2006-01-30 09:49 PM
Hi Orlando,
just some ideas: Do you feed the watchdog regularly? Are you sure not to get stuck in a discharged interrupt? ...because an unexpected watchdog-reset might cause the error as you describe it. Regards WoRo