Using pps tools what is a default port data dir in out called?
I set up pins for spi mosi and sck but want to reset pins to standard ports. What in the pps input output lists is a data port?
See .. \GCB@Syn\GreatCowBasic\Demos\Vendor Boards\Xpress Evaluation Board\20 Temperature Sensor_Alarms to Serial Terminal.gcb This will show you Serial and I2C.
I used similar from pps tool to set up other pins then this to set up other pins so pins are defined twice with same names cos I don't know what spi cs and dc are. If just in out, what is that called in pps tool in out lists please?
#startupInitPPS,85SubInitPPS'Module: MSSP1RB5PPS=0x0015'SDO1 > RB5RB3PPS=0x0014'SCK1 > RB3SSP1CLKPPS=0x000B'RB3 > SCK1 (bi-directional) End Sub
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some pins need to be bi-directional to work such as Clock lines, shared data lines etc.
You dont have to woryy if the line should be bi-directional or not.
PPS takes care of it for you and will make both entrys if needed.
SPI has different names on diferent devices and what is confusing you here is that you are used to the Arduino names. The link I posted bellow will talk you through srtting up SPI.
in addition to that:
CS is Chip Select, also known as SS or Slave Select.
You only need that if you are using the PIC SPI in Slave rather than Master mode.
I dont know what you mean by DC though.
Follow the tutorial in the post below and then ask here if you have more questions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Chris-I have set pins as clk and mosi. I want to reset them as gpio. What is that called in the pps tools in out lists please.
How come everyone else knows this info?
Snippets are great to copy but don't explain the pps tool.
I do want to use predefined templates I did myself. Cheers.
Last edit: stan cartwright 2018-05-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you don't want them to be CLK and MOSI then don't allocate them.
PPS is not intended to be changed on the fly, it should be allocated during initialisation only.
With that is mind I am not aware of any PPS command to deallocate a pin.
You could probably do It manually by clearing the appropriate bits of the appropriate registers.
You will have to have a very thorough understanding of the Datasheet and PPS in order to try that and not break anything.
I do not recommend it.
As for defined templates nothing in PPS is predefined.
You are looking at examples not templates.
Read the Tutorial, use the PPS tool and create any combination of devices you wish.
You do not need to copy and paste from the examples.
Cheers
Chris
Last edit: Chris Roper 2018-05-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PPS is just a set of registers that control a set of Multiplexers that in turn connect the external pins to the internal Peripherals. When power is lost so are the PPS settings.
That is why PPS must go at the top of your program and is an integral part of the initialisation of the Device along with setting the clock speed and the configuration bits.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anobium-demos don't show what the options in pps tools in out mean and the data sheet doesn't match up much--image 1st post.
I've set pin as clk with pps and copied/pasted into my code then flashed.
I erased the pps code and used different pin as clk then copied/pasted into my code then flashed. Do I now have 2 pins the same as the pin set 1st time has not been set second time to anything else like gpio?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PPS is just a set of registers that control a set of Multiplexers that in turn connect the external pins to the internal Peripherals. When power is lost so are the PPS settings.
OK, I thought it was like eeprom or ula, ie permanent unless reprogrammed. Sorted.
As I'm testing RC5 this ili9341 doesn't work. Flashes ok.
Just sdo and sck were sorted with pps tool.
wiring ok. Connected display to uno,works. Retried xpress didn't.
Is it dc and/or cs ports cause problem?
#chip 16f18855,32#option Explicit#include<glcd.h>#startup InitPPS, 85SubInitPPSRB5PPS=0x0015'SDO1>RB5RB3PPS=0x0014'SCK1>RB3SSP1CLKPPS=0x000B'RB3>SCK1(bi-directional)EndSub#define GLCD_TYPE GLCD_TYPE_ILI9341#define GLCD_DC portb.0#define GLCD_CS portb.2#define GLCD_RESET portc.2 ; Reset line Tie high..not needed#define GLCD_DO portb.5 ; Data out | MOSI SDI#define GLCD_SCK portb.3 ; Clock Line SCK#define ILI9341_HardwareSPI #define GLCD_EXTENDEDFONTSET1GLCDfntDefaultsize=1GLCDRotate(landscape)GLCDCLSILI9341_BLUEGLCDPrint(0,0,"hello",ILI9341_WHITE)doloop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using pps tools what is a default port data dir in out called?
I set up pins for spi mosi and sck but want to reset pins to standard ports. What in the pps input output lists is a data port?
Last edit: stan cartwright 2018-05-09
Demos are a great place to start.
See .. \GCB@Syn\GreatCowBasic\Demos\Vendor Boards\Xpress Evaluation Board\20 Temperature Sensor_Alarms to Serial Terminal.gcb This will show you Serial and I2C.
But, as you are using a PPS part you can choose any port and PPS Tool will create the routine for you.
For SPI. A quick search of the demos.
..\GCB@Syn\GreatCowBasic\Demos\GLCD Solutions\GLCD Simple Demonstration Solutions\GLCD_Simple_Demonstration_SPI_16F18855_for_ILI9486L@32.gcb
But, as you are using a PPS part you can choose any port and PPS Tool will create the routine for you.
And, you can create you own routine that has Serial, SPI and I2C all defined.
I used similar from pps tool to set up other pins then this to set up other pins so pins are defined twice with same names cos I don't know what spi cs and dc are. If just in out, what is that called in pps tool in out lists please?
Some pins need to be bi-directional to work such as Clock lines, shared data lines etc.
You dont have to woryy if the line should be bi-directional or not.
PPS takes care of it for you and will make both entrys if needed.
SPI has different names on diferent devices and what is confusing you here is that you are used to the Arduino names. The link I posted bellow will talk you through srtting up SPI.
in addition to that:
CS is Chip Select, also known as SS or Slave Select.
You only need that if you are using the PIC SPI in Slave rather than Master mode.
I dont know what you mean by DC though.
Follow the tutorial in the post below and then ask here if you have more questions.
If I am reading you correctly you are asking how to set a pin as normal I/O.
With PPS you don't have to, all pins are generic I/O pins and addressed as normal
i.e.
Dir PortB.3 Out
Dir PortC.2 In
Etc.
If you want to use a pin as something other than standard I/O you use PPS to allocate the pin to a Perephiral as Evan has done above.
I did write a short tutorial on PPS here that may help:
https://sourceforge.net/p/gcbasic/discussion/projects%26guides/thread/3fa399ca/?limit=25#0d45
Cheers
Chris
Chris-I have set pins as clk and mosi. I want to reset them as gpio. What is that called in the pps tools in out lists please.
How come everyone else knows this info?
Snippets are great to copy but don't explain the pps tool.
I do want to use predefined templates I did myself. Cheers.
Last edit: stan cartwright 2018-05-09
If you don't want them to be CLK and MOSI then don't allocate them.
PPS is not intended to be changed on the fly, it should be allocated during initialisation only.
With that is mind I am not aware of any PPS command to deallocate a pin.
You could probably do It manually by clearing the appropriate bits of the appropriate registers.
You will have to have a very thorough understanding of the Datasheet and PPS in order to try that and not break anything.
I do not recommend it.
As for defined templates nothing in PPS is predefined.
You are looking at examples not templates.
Read the Tutorial, use the PPS tool and create any combination of devices you wish.
You do not need to copy and paste from the examples.
Cheers
Chris
Last edit: Chris Roper 2018-05-09
Is it the pins aren't permanent after power off and go back to as new and they're set at run time?
Yes.
PPS is just a set of registers that control a set of Multiplexers that in turn connect the external pins to the internal Peripherals. When power is lost so are the PPS settings.
That is why PPS must go at the top of your program and is an integral part of the initialisation of the Device along with setting the clock speed and the configuration bits.
Anobium-demos don't show what the options in pps tools in out mean and the data sheet doesn't match up much--image 1st post.
I've set pin as clk with pps and copied/pasted into my code then flashed.
I erased the pps code and used different pin as clk then copied/pasted into my code then flashed. Do I now have 2 pins the same as the pin set 1st time has not been set second time to anything else like gpio?
You must have read Chris's PPS tuturial very quickly.
See this post - https://sourceforge.net/p/gcbasic/discussion/579126/thread/e43c9ad9/#aed5 It does say what to do.
PPS is just a set of registers that control a set of Multiplexers that in turn connect the external pins to the internal Peripherals. When power is lost so are the PPS settings.
OK, I thought it was like eeprom or ula, ie permanent unless reprogrammed. Sorted.
As I'm testing RC5 this ili9341 doesn't work. Flashes ok.
Just sdo and sck were sorted with pps tool.
wiring ok. Connected display to uno,works. Retried xpress didn't.
Is it dc and/or cs ports cause problem?
I changed sdo,do,dc,cs to port c and the display works. Dunno why.