Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I have started writing a driver for my first Async Flash Memory Chip, it features 2 8-bit busses, one for control signals and the other for IO.
I have not had any trouble thus far with the control signals, but I have been having some problems with using the bi-directional IO. Namely, I really am not sure how I should configure the IO port. I am not having any problems writing out over it, but when I should be expecting input from the flash chip from it's ID register, I'm getting nothing.
There seem to be a few options as far an configuring the port under the general settings, digital in/out, or I could choose bi-directional. The drive mode is the part that is giving me the most problems, there are quite a few options and I don't really know how to pick the correct one. I have tried experimenting quite a bit trying to find the right one, but at this point I feel like it would be best to really understand what is going on.
I have read through the application notes and data sheets regarding the GPIO, I think what is stumbling me now, is that I am having a hard time figuring out from the data sheet how the flash chip is supposed to be driving the PSOC's pins when the flash chip is in output mode.
Also, as an added note, I am providing my own voltage for Vddi0, the chip has a supply of 1.8v which I am also giving to Vddio, which is serving as the supply for ports 4 and 0. I am assuming that it will consider 1.8v as the max logic level on these two ports and not 3.3v in this configuration.
I really appreciate any guidance or help that you guys can provide, I have learned quite a bit from here so far!
Configuring a pin for input AND output needs the oe (output enable) feature. the reason is: Reading from the pin would deliver the voltage driven BY the pin if the output is enabled. So you need some logic from or to extern that tells the PSoC or the connected device that data should be placed on the port (oe high) and that data my be read from port (oe low).
The drive mode the port uses is not relevant, I would always use "strong" as long as it is not a bus that uses pull-ups or so.
The switching of the drive mode can only be done in software, while using output enable can be done in hardware and when using a control-register in software,too. Additionally this is a quite usual way for i/o configuration.