??? 05/24/07 14:33 Read: times |
#139753 - serial communication with 8052 in c# |
Hi all,
I've started to do some work on my 8052 board again, does anybody know a good starting point where I can learn how to make my program output to be sent to serial device? I have some tutorials with my reads51 software where I can do some output to the serial line: #include <cSio51.h> main(){ // --- initialize serial port (9600 Baud) --- InitSerialPort0(DEF_SIO_MODE); //DEF_SIO_MODE is defined in <sio51.h> cprintf("test"); while(1); } //--- end And here's the .h file ------- #ifndef __SIO51_H #define __SIO51_H // prototypes void PrtDec(int n); void PrtHex(unsigned int u); void putc(char c); void puts(char *sz); char getc(void); void printf(char *sz); void InitSerialPort0(int nMode); #define _9600_11_059_TIMER1 0 #define _9600_24_TIMER1 1 #define _9600_12_80535BRG 2 #define _9600_10_C515BRG 3 // global definition of serial mode #define DEF_SIO_MODE _9600_11_059_TIMER1 // macros to access the function argument stack in assembly #define DPTRAST mov a, BPL \ add a, #0xFA \ mov dpl, a \ mov a, BPH \ addc a, #0xFF \ mov dph, a #define DECDPTR xch a, dpl \ jnz $+4 \ dec dph \ dec a \ xch a, dpl #endif ------- If I try to compile the same program using different tools I'm getting errors, I believe this is because main 8052.h file(which is not known to me) is included by default, would anyone have any suggestions on that at all? Cheers Tomas |
Topic | Author | Date |
serial communication with 8052 in c# | 01/01/70 00:00 | |
C# is for PCs | 01/01/70 00:00 | |
it can NOT be included without you having source o | 01/01/70 00:00 | |
full source code | 01/01/70 00:00 | |
Proprietaries | 01/01/70 00:00 | |
back to uart | 01/01/70 00:00 | |
examples for sdcc | 01/01/70 00:00 | |
sdcc | 01/01/70 00:00 | |
works | 01/01/70 00:00 | |
Keil - maybe not | 01/01/70 00:00 | |
end | 01/01/70 00:00 | |
...but the Keil examples might be good for SDCC...![]() | 01/01/70 00:00 |