Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC18F45K20 6 channel software PWM

Status
Not open for further replies.
I've been involved in few debates about "ASM vs. C" and I've always defended the C language. But, you really have to know the language and the tools, especially your compiler, when writing software for microcontrollers. Non-standard C, like the above, is not unusual in the world of microcontrollers. ASM knowledge is very useful, if not essential, for one to be able to write good C programs for embedded systems. But the thing is, when you write ASM, you know what you get. When you write C, you better make sure what you get. Sorry for off-topic.

It's very easy to have a small header that allows you to add standard width types to C.

I normally use something like this with C18.

Code:
#ifdef INTTYPES
#include <stdint.h>
#else
#define INTTYPES
/*unsigned types*/
typedef unsigned char uint8_t;
typedef unsigned int uint16_t;
typedef unsigned long uint32_t;
typedef unsigned long long uint64_t;
/*signed types*/
typedef signed char int8_t;
typedef signed int int16_t;
typedef signed long int32_t;
typedef signed long long int64_t;
#endif

https://pubs.opengroup.org/onlinepubs/007904975/basedefs/stdint.h.html
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top