Use a macro for that.And to clear a bit...
Use a macro for that.And to clear a bit...
Sure (if you use XC8):Is there a more intuitive way to set an individual bit than specifying the binary equivalent of an 8-bit register value in hexadecimal?
it seems that being able to code something like
setLDAbit = 1 is more intuitive to me than
PWM1LDCON = 0x80.
PWM1LDCONbits.LDA = 1;
Sweet. I didn't get very far into the xc8 manual before I got bug-eyed.Sure (if you use XC8):
C:PWM1LDCONbits.LDA = 1;
That might make sense for someone who works with this stuff all-day. I need tools like MCC to simplify the process. I get the purists perspective, but that will never be me. The microcontroller itself is just another tool for me to get something real done. Time spent being Linus Torvalds of the microchip world is money wasted.No point in using machine generated code. Read the data sheet and you will always write the correct code, every single time.
Ha ha, that's a good one.Read the data sheet and you will always write the correct code, every single time.
then get an arduino. they do exactly what you wanted to do.The microcontroller itself is just another tool for me to get something real done. Time spent being Linus Torvalds of the microchip world is money wasted.
No, this isn't a hobby. I researched this thoroughly, it is pic programming i intend to learn. MCC is a wonderful tool to speed development. Not a crutch for not learning the registers. Nothing in this thread has been about MCC making bad code. In fact if I had tried to hand code all of the registers I'm sure I would have failed. MCC has given me working example code. Considering how well it worked I see no reason to ever fully hand configure a chip. You still have to understand what all the registers are and how they work. It just lets you visualize everything graphically.then get an arduino. they do exactly what you wanted to do.
I agree with this. Just use it with caution because the code generation was written by software developers just like us. They make mistakes, too. I like to generate it with MCC and then check to make sure everything jives with the datasheet. Also, don't pick the wrong chip like I did earlierMCC is a wonderful tool to speed development. Not a crutch for not learning the registers.
I don't agree with this. You seem very capable Good luck!In fact if I had tried to hand code all of the registers I'm sure I would have failed.