Open main menu

Speeduino β

Changes

Secondary Serial IO interface

146 bytes added, 3 years ago
no edit summary
* '''Send an "r"'''
if you send an "r" to the port you must also send 5 6 further bytes immediately after the "r". These are the Speeduino TS canID, the r type command 0x30(48 in decimal), a 2 byte offset and a 2 byte length. the offset is the position in he realtime list you want the data returned to start from and the 2 byte length is the number of bytes you want returned. the bytes are sent LSB first .
The port will reply with ,
"r" confirming the received instruction (send as 0x72 in hex) ,
The port will now transmit a single byte in hex ,this is the value of the "r" , type command, confirming what was requested (ths should be this is typically 0x30).
The port will then transmit the realtime data requested starting at the byte position sent for the number of bytes length.
chosen afr target
20 - (byte)lowByte(currentStatus.PW1 / 100) ; Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
21 - highByte(currentStatus.PW1); Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS. 22 - currentStatus.tpsDOT
TPS DOT
22 23 - currentStatus.advance
Current spark advance
23 24 - currentStatus.TPS
TPS (0% to 100%)
24 25 - lowByte(currentStatus.loopsPerSecond)
loops per second LB
25 26 - highByte(currentStatus.loopsPerSecond)
loops per second HB
26 27 - lowByte(currentStatus.freeRAM)
freeRam LB
27 28 - highByte(currentStatus.freeRAM)
freeRam HB
28 29 - currentStatus.boostTarget
Target boost pressure
29 30 - currentStatus.boostDuty
current pwm boost dutycycle
30 31 - currentStatus.spark
Spark related bitfield
31 32 - lowByte(currentStatus.rpmDOT)
rpmDOT must be sent as a signed integer
32 33 - highByte(currentStatus.rpmDOT)
rpmDOT HB
33 34 - currentStatus.ethanolPct
Flex sensor value (or 0 if not used)
34 35 - currentStatus.flexCorrection
Flex fuel correction (% above or below 100)
35 36 - currentStatus.flexIgnCorrection
Ignition correction (Increased degrees of advance) for flex fuel
 
36 - getNextError()
Error codes
37 - currentStatus.idleLoad
73 - currentStatus.tpsADC
TPS (Raw 0-255)
 
74 - getNextError()
Error codes
 
== Read external analog data from a remote device ==
===IF the remote device is connected directly to Serial3.===
You must first send an "G" ,
Then a '1' to flag the cmd is valid,
Then the Can input channel (this is the channel number that Speeduino issued with the request.
Then send 8 bytes of data. The Data you wish to send is placed in bytes 0 and 1 (LSB and MSB respectively)if it is two bytes long or in byte 0 if it is only a single byte long .
125
edits