
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
131
Revision 1.0, 2011-12-15
2.38.9
Code Example
Figure 22
Code example for usage of Send_RF_Telegram()
// Library function prototypes
#include "SP37_ROMLibrary.h"
void main()
{
// Return value of send RF telegram is stored in sendRF_StatusByte
signed char sendRF_StatusByte;
// Array for pattern descriptor table
unsigned char idata descriptorPtr[10];
// Start of table pattern indicator
// battery measurement enabled, no delay for delayOSC
descriptorPtr[0] = 0x80;
// Transmit type pattern descriptor
// Type: ASK, Manchester
descriptorPtr[1] = 0x10;
// Length: 14 bits
descriptorPtr[2] = 14;
// Data: 8 bits (7->0) transmitted: 01010101
descriptorPtr[3] = 0x55;
// Data: 6 bits (7->2) transmitted: 101001
descriptorPtr[4] = 0xA5;
// Transmit type pattern descriptor
// Type: FSK, Manchester
descriptorPtr[5] = 0x00;
// Length: 16 bits
descriptorPtr[6] = 16;
// Data: 8 bits (7->0) transmitted: 10101010
descriptorPtr[7] = 0xAA;
// Data: 8 bits (7->0) transmitted: 01010101
descriptorPtr[8] = 0x55;
// End of table pattern descriptor
descriptorPtr[9] = 0xF1;
// These tasks need to be done, details are application dependent
// RF Transmitter SFR Initialization
// Start xtal oscillator function call
// VCO tuning function call
// Start supply voltage function call (if required)
// Send RF telegram function call, baudrate = 9600 bit/s
sendRF_StatusByte = Send_RF_Telegram(9600, descriptorPtr);
//
Get supply voltage function call (if required)
}