vsmGuy
Advanced Member level 2
Why is library support for 8051 so meagre ?
On PICs for example
1. One just writes a
to start using the serial port, and better still, the CCS compiler will emulate a serial port in software if a UART does not exist - all transparent to the user.
But here, one has to explicitly set the registers and timer values to get the serial posrt working.
CCS will also warn a user if the serial port speed selected by him will give a very high error rate - none of the 8051 compilers do that.
2. Timers are a major headache here. No support for delays anywhere. In CCS one just writes
to get a delay for 5ms, but here I have to explicitly setup either software delays or use some free timer to handle this task for me - involving lots of mechanical computations which a compiler/preprocessor can easily handle.
Why is this so ?
At this rate I would be as well off as writing in ASM if I have to handle setting all the peripherals myself.
What do you guys have to say about this ?
On PICs for example
1. One just writes a
Code:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
to start using the serial port, and better still, the CCS compiler will emulate a serial port in software if a UART does not exist - all transparent to the user.
But here, one has to explicitly set the registers and timer values to get the serial posrt working.
CCS will also warn a user if the serial port speed selected by him will give a very high error rate - none of the 8051 compilers do that.
2. Timers are a major headache here. No support for delays anywhere. In CCS one just writes
Code:
delay_ms(5);
to get a delay for 5ms, but here I have to explicitly setup either software delays or use some free timer to handle this task for me - involving lots of mechanical computations which a compiler/preprocessor can easily handle.
Why is this so ?
At this rate I would be as well off as writing in ASM if I have to handle setting all the peripherals myself.
What do you guys have to say about this ?