- Name:
-
hspiout
- Syntax:
-
HSPIOUT (data, {,data,...}) HSHOUT (data, {,data,...})
Data - is a constant/variable of the byte data to output
- Description:
-
The hspiout (hshout also accepted by the compiler) command shifts out data byte using the SPI hardware pins.
This command transmits SPI data via the microcontroller's SPI hardware pins. This method is faster and more code efficient than using the 'bit-banged' spiout command.
When connecting SPI devices (e.g. EEPROM) remember that the data-in of the EEPROM connects to the data-out of the PICAXE, and vice versa. Note that a hspisetup command must be issued before this command will function. Due to the internal operation of the microcontrollers SPI port, a hspiout command will only function when the hspiin 'input pin' is in the expected default state. If this pin is incorrect (e.g. high when it should be low), the hspiout byte cannot be sent (as the microcontroller automatically detects an SPI error condition). After 2.3 seconds of fault condition the PICAXE microcontroller will automatically reset.