phaf@hippo.ru.ac.za (Andre Ferreira) (05/26/91)
Greetings all I am desperate ! I am trying to transfere a (ANSI) C program written for Intel's 8052 chip onto the Dallas DS5000T chip but am having hassels. The problem is this: The program has been now reduced to one that simply initializes the serial port (on chip) and then sends a single ASCII A to the PC connected to the chip (via a max232 driver). The program layout is that I have a procedure (serial_init ()) that writes to the relevent special function registers and another that checks if the transmitter buffer is empty and then sends the A. I began by calling them both from the main () proc and nothing happended, I then called the write_char proc from the serial_init proc, now the chip began spewing out lines of junk to the terminal. I then checked the baud rate with an 'scope and it was correct. The thing that has got me, niether the chip or cross compiler documentation are much help, is that the program never seems to return from a procedure once it is called. The program as it is runs with no problem on my 8052 development system, the difference being that the I am trying to put the program into the embedded ram on the Dallas chip where before the program ran from external EEprom on the 8052. Now the problem would appear to be some thing to do with the stack but my cross compiler assures me that the C system creates a stack. Does anbody have any ideas, I may be doing somthing dumb but for the life of me can't see it and I've been looking for a good two and a half weeks now. Thanks in advance. Andre -- Andre Ferreira______Internet: PHAF@Hippo.ru.ac.za Department of Physics and Electronics_____Rhodes University Grahamstown____South Africa____Phone: +27 [0]461 22023 xt 451
mortenpp@darwin.uio.no (Morten Paul Pedersen) (05/27/91)
Perhaps one reason to your problems is that DS5000T is compatible with 8051 and not 8052. The 8052 has more internal RAM than the 8051, ( 256 bytes in 8052 and only 128 in 8051 ). You might have a problem if this area is used as stack. Morten.