We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
another newbie question.
I have a piece of code that I am porting from PICC. In PICC, you can make reference to specific pins ("#define sclk GPIO5" for example), and in your code, you can write to sclk to change the pin output on GPOI5. This makes porting code or changing pin layout so much easier as you can simple redefine sclk to a different pin to make the code work.
ARM seems to prefer to change its pin output through IOSET / IOCLR.
To make the existing PICC code work, I would prefer to be able to define certain pins logically, and change their states by referencing their logic names.
how do you do that in ARM? Thanks in advance.
Just a footnote. The PIC has the BCF and BSF instructions, allowing single-bit clear/set. Without bitwise instructions, the best you can do is to perform 8-bit, 16-bit or 32-bit writes, in which case you either need to mask away the bits you don't want to affect, or do a load/modify/store, or create a peripherial where each bit can be written to using individual memory addresses.
A processor vendor are not - by license - allowed to modify the instruction set, so when implementing the GPIO logic, they must base that logic on the capabilities of the instruction set of the core.
"Just a footnote. The PIC has the BCF and BSF instructions, allowing single-bit clear/set. Without bitwise instructions, the best you can do is to perform 8-bit, 16-bit or 32-bit writes, in which case you either need to mask away the bits you don't want to affect, or do a load/modify/store, or create a peripherial where each bit can be written to using individual memory addresses."
do BFI/BFC count?