chipKIT® Development Platform

Inspired by Arduino™

Modifying registers using register names

Created Tue, 18 Sep 2012 14:48:49 +0000 by chipkitdude


chipkitdude

Tue, 18 Sep 2012 14:48:49 +0000

Hello everyone! This is my first post. Sorry if this question has already been answered, but I could not find it with the search function. Is it possible in MPIDE to write programs by modifying the registers directly by using their register names and not using the function calls provided by the Wiring library, or whatever it's called? I just want to initialize the microcontroller registers myself and still write the program in C. Usually there is a header file to include in order to be able to do this.


majenko

Tue, 18 Sep 2012 15:02:50 +0000

Yes. You generally just do it. The wiring takes care of the right header to include.


EmbeddedMan

Tue, 18 Sep 2012 17:06:20 +0000

That is correct. The processor header files that define the registers for each processor should be included properly without you having to do anything (at least in a sketch - I think it's different for a library). If you see a register in the datasheet (like PORTA) you can normally count on PORTA, PORTASET, PORTACLR, PORTAINV and PORTAbits to all be properly defined for use use in the code.

*Brian


chipkitdude

Wed, 19 Sep 2012 13:54:08 +0000

Excellent! Thank you very much!