pin direction example in prop c
pilot0315
Posts: 910
in Propeller 1
I have been struggling with the pin direction commands in prop C.
I want to take this from SPIN:
dira[CS_PIN]~~
dira[WR_PIN]~~
dira[RS_PIN]~~
dira[REST_PIN]~~
dira[14..7]~~
dira[disp_pin]~~
to propeller C.
The information in the propgcc manual is not forthcomming
Any suggestions wold help. I have tried the suggestions in:
https://learn.parallax.com/tutorials/robot/elev-8/io-elev-8-flight-controller/pin-control-registers
copied and pasted the stuff there but got error messages.
Thanks
Looking in the
I want to take this from SPIN:
dira[CS_PIN]~~
dira[WR_PIN]~~
dira[RS_PIN]~~
dira[REST_PIN]~~
dira[14..7]~~
dira[disp_pin]~~
to propeller C.
The information in the propgcc manual is not forthcomming
Any suggestions wold help. I have tried the suggestions in:
https://learn.parallax.com/tutorials/robot/elev-8/io-elev-8-flight-controller/pin-control-registers
copied and pasted the stuff there but got error messages.
Thanks
Looking in the
Comments
They are both documented at the following link:
https://cdn.rawgit.com/parallaxinc/propsideworkspace/master/Learn/Simple%20Libraries%20Index.html
simpletools.h is as its name suggests the easy way. I have copied the IO pin functions and brief descriptions below.
The other library is propeller.h. For the pins the propeller.h library does not use functions. You enter the 32 bit pin values into:
The advantage of propeller.h is that it may be a more familiar way for people used to spin or PASM, and it executes faster than the simpletools.h functions.
Hope this helps,
Tom M.
The stuff inside the "#ifdef __GNUC__" block is fluff that allows the output to be compiled by Catalina as well as PropGCC, so you can ignore that. The interesting stuff is the foo_test() function, where you can see how to set DIRA the way Spin does.
I tried the method like the one Johnny Mac indicated but I got error messages. I will post it.
Thanks to all.
I will get back
thanks
See attached it did not compile. The errors are the same that I got originally.
Thanks