Author
|
Matrix Ltd
|
Version
|
1.2
|
Category
|
DSP
|
Input ADC component
Allows the values from a buffer to be assigned driectly from an analog enabled pin. Either a single sample at a time or a number of samples. Auto scales the digital value to fill the entire range of the specified buffer type.
Detailed description
No detailed description exists yet for this component
Examples
Some examples containing the Input ADC component.
On Off Control
PID Control
Downloadable macro reference
|
AddSample
|
Adds a single ADC sample to the current location in the specified buffer. If Auto Scale is enabled then the sample will be scaled to correctly fit inside the buffer. Auto increments current location.
|
- VOID
|
Return
|
|
AddSampleArray
|
Adds a single ADC sample to the current location in the specified buffer. If Auto Scale is enabled then the sample will be scaled to correctly fit inside the buffer. Auto increments current location.
|
- UINT
|
SampleDelay
|
Number of us in between each sample.
|
- VOID
|
Return
|
|
Initialise
|
Configures the UART serial interface.
|
- VOID
|
Return
|
|
Initialise
|
Configures the UART serial interface.
|
- VOID
|
Return
|
|
GetError
|
Checks for any errors and returns the error code. 1=ModuleBusy, 2=SleepMode, 3=SerialError, 4=ChecksumError, 5=TrackOutOfScope, 6=TrackNotFound, 7=InsertionError, 8=SDFail, 10=Sleep
|
- BYTE
|
Return
|
|
WhilePlaying
|
Blocking function that waits for module to stop being busy. Returns true if the module is still busy and the timeout period has passed.
|
- UINT
|
Timeout
|
Number of milliseconds to wait, 0=WaitForever
|
[[File:]] -
|
Return
|
|
IsPlaying
|
Checks to see if the last played track is still playing
|
[[File:]] -
|
Return
|
|
GetReplyByte
|
Reads a single byte from the last reply. Each reply contains 4 bytes starting with the command code.
|
- BYTE
|
Index
|
Range: 0-3 / 0=Command, 1=Feedback, 2=Data MSB, 3=Data LSB
|
- BYTE
|
Return
|
|
SkipTrack
|
Jump to the next or previous track
|
[[File:]] -
|
Direction
|
0=Next, 1=Previous
|
- VOID
|
Return
|
|
PlayTrack
|
Plays track from the selected folder. MP3 & Advert folder track numbers should be 4 characters long e.g. 0001 any name.mp3, Other folder track numbers should be 3 characters long e.g. 001 Any name.mp3, Root the Track played in placement order.
|
- BYTE
|
Directory
|
0=Root, 1=Folder "01" - 99=Folder "99", 100=MP3, 101=Advert
|
- UINT
|
Track
|
Track number 1="001*.MP3" / "0001*.MP3", 100="100*.MP3" / "0100*.MP3"
|
- VOID
|
Return
|
|
Initialise
|
Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros.
|
- VOID
|
Return
|
|
ReadAnalogAsInt
|
Reads one of the analogue components as an Integer value
|
- BYTE
|
Channel
|
0 = LDR, 1 = POT
|
[[File:]] -
|
Return
|
|
RemapCharacter
|
Assigns a remap character allowing the PrintString function to automatically swap between pre-defined characters. The characters can be custom (in the range 0-9) or can point to an existing character in the LCD character map.
|
- BYTE
|
RemapIdx
|
Remap Index, Range: 0 to (Remap Characters - 1)
|
- BYTE
|
SearchCharacter
|
Character to look for a replace
|
- BYTE
|
ReplacementCharacter
|
New character value to use in place of the search character.
|
- VOID
|
Return
|
|
Start
|
Startup routine required by the hardware device. Automatically clears the display after initialising.
|
- VOID
|
Return
|
|
SetLEDState
|
Sets the state of a single LED
|
- BYTE
|
Port
|
0 = PortA, 1 = PortB
|
- BYTE
|
LED
|
0 = LED0, 7 = LED7
|
- BYTE
|
State
|
|
- VOID
|
Return
|
|
Initialise
|
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Buffer Size
|
Number of individual elements the buffer can store, default 1.
|
|
Buffer Type
|
Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.
|
|
VRef option
|
Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage VDD - Defines the microcontrollers power supply pin as the max reference, VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage.
|
|
Conversion speed
|
Clock setting to select how fast the ADC peripheral will perform an ADC conversion. The FRC setting is based on a RC time base and so will vary with temperature and pressure. Other settings are generally based on divisions of the master clock.
|
|
Acquisition cycles
|
Number of micro seconds to wait for the ADC input to charge before starting the analogue sample.
|
|
Bit Depth
|
Maximum number of digital bits the ADC can sample. 8 bit = ADC range 0 - 255 10 bit = ADC range 0 - 1023 12 bit = ADC range 0 - 4095
|
|
Connections
|
|
Channel
|
Analogue Input Channel - Which pin is the analogue input connected to?
|
|
Simulations
|