freetronics / FTOLED

Arduino software library to drive OLED display modules
http://www.freetronics.com/oled128
GNU General Public License v3.0
26 stars 18 forks source link

CS labelling #2

Closed lukeweston closed 11 years ago

lukeweston commented 11 years ago

The two CS lines coming into the board from the main external I/O header (for the display and the SD card) should not be labelled as CS not nCS, because they're actually inverted and they're active-high, not active low. When the gates of the MOSFETs are driven high the actual active-low nCS lines on the OLED and SD are pulled low and the SPI interfaces enabled. So it should be documented that those CS lines going into the board are actually active-high. (Which is a bit counterintuitive, the opposite of SPI devices usually.)

What is the intended purpose of the FETs? Protection against 5V input on the CS lines?

projectgus commented 11 years ago

Hi Luke,

Thanks for looking over the schematic, I really appreciate the review.

You're right, I had CS & nCS backwards. I'd assumed CS was active-low by convention, but now I see nCS usually signifies active-low and it seems CS can mean either active-low or active-high depending on context (gee it'd be nice to have a spec for these things!) I'll fix that.

The inverting FET for the OLED interface was added by Marc in the original draft schematic, my understanding is to keep CS deasserted during reset. It's chosen instead of a simple pullup because this way it also protects the device from seeing 5V if the Arduino sketch drives the output high.

However, now you draw my attention to it, having an inverted CS line on the microSD card slot means it won't work with the existing Arduino library, existing hardware just uses a voltage divider. I'll have to remove that one to stay compatible.

Cheers,

Angus

lukeweston commented 11 years ago

The n (as in nCS or nRESET for example) is equivalent to the "bar" symbolism to signify that any particular digital signal is inverted or active-low, in a way that can be typed easily without fancy typesetting.

Sometimes people use alternative characters, eg. !CS (which is how you do barred net names and barred text etc in Eagle) or *CS or CS# etc.

Sometimes people just say CS or RESET or whatever it is and assume you know something is active-low in that context, but it's good to document it specifically.

Cheers, Luke

On 27/03/2013, at 2:20 PM, Angus Gratton notifications@github.com wrote:

Hi Luke,

Thanks for looking over the schematic, I really appreciate the review.

You're right, I had CS & nCS backwards. I'd assumed CS was active-low by convention, but now I see nCS usually signifies active-low and it seems CS can mean either active-low or active-high depending on context (gee it'd be nice to have a spec for these things!) I'll fix that.

The inverting FET for the OLED interface was added by Marc in the original draft schematic, my understanding is to keep CS deasserted during reset. It's chosen instead of a simple pullup because this way it also protects the device from seeing 5V if the Arduino sketch drives the output high.

However, now you draw my attention to it, having an inverted CS line on the microSD card slot means it won't work with the existing Arduino library, existing hardware just uses a voltage divider. I'll have to remove that one to stay compatible.

Cheers,

Angus

— Reply to this email directly or view it on GitHub.

projectgus commented 11 years ago

Oic. I hadn't realised they were equivalent, was just reading "n" it as "not" (ie opposite of whatever the usual convention is.) Thanks for explaining, got you now.