This is true. Both have their plus and minus. For example PICs offer a wide range of PWM frequencies but all the PWM channels have the same frequency (as far as I have seen). With some AVRs you can have two PWM channels with different frequencies.At least you are taking the time to investigate both. Once you have played with the AVR you will be able to speak from first hand experience.
hgmjr
Yes I found that. However, I wanted to ask about Codevision and not GNU (mistake).Yes, If you include the header file delay.h.
hgmjr
Similar to WinAVR :Yes I found that. However, I wanted to ask about Codevision and not GNU (mistake).
Does anyone know if Codevision has a delay_ms() function?
#include <delay.h>
#include <mega8.h>
/*if not defined in the Project-Configure-C Compiler menu
xtal frequency needs to be defined.These delay functions
need to know the clock speed. Also you have to disable
interrupts for their timing to be accurate.*/
#define xtal 8000000L
int main(void)
{
unsigned int my_delay = 100;
//disable interrupts
#asm("cli");
//do delay of 100 milliseconds
delay_ms(my_delay);
//do delay of 100 microseconds
delay_us(my_delay);
//re-enable interrupts
#asm("sei");
while(1);
}
This is information about CCS compiler that is good to know.GCC in common with most other compilers expects you to know how your microcontroller operates and what registers have to be configured for you program to work.
CCS for the PIC is a C-like compiler that is rich in library functions that hide a lot of the basic register setup detail from the user. The up side of this is fast code development without the need to learn anything about the internal operation of the PIC.
The down side is, without a knowledge of the PIC internals your are limited to using the supplied library functions.
An even bigger problem is that because CSS code relies so heavily on its library functions, code written for CSS not easily ported to other C compilers.