17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Functional Overview<br />

Writes N bytes to address from pointer<br />

Relevant Preprocessor:<br />

#ROM address={list}<br />

write_eeprom = noint<br />

Relevant Interrupts:<br />

INT_EEPROM<br />

Can also be used to put data EEPROM memory data into the<br />

hex file.<br />

Allows interrupts to occur while the write_eeprom() operations<br />

is polling the done bit to check if the write operations has<br />

completed. Can be used as long as no EEPROM operations<br />

are performed during an ISR.<br />

Interrupt fires when EEPROM write is complete<br />

Relevant Include Files:<br />

None, all functions built-in<br />

Relevant getenv() parameters:<br />

DATA_EEPROM<br />

Example Code:<br />

For 18F452<br />

#rom 0xf00000={1,2,3,4,5}<br />

Size of data EEPROM memory.<br />

//inserts this data into the hex file. The data eeprom address<br />

//differs for different family of chips. Please refer to the<br />

//programming specs to find the right value for the device<br />

write_eeprom(0x0,0x12); //writes 0x12 to data eeprom location 0<br />

value=read_eeprom(0x0); //reads data eeprom location 0x0 returns 0x12<br />

#ROM 0x007FFC00={1,2,3,4,5} // Inserts this data into the hex file<br />

// The data EEPROM address differs between PICs<br />

// Please refer to the device editor for device specific values.<br />

write_eeprom(0x10, 0x1337); // Writes 0x1337 to data EEPROM location 10.<br />

value=read_eeprom(0x0); // Reads data EEPROM location 10 returns 0x1337.<br />

Data Signal Modulator<br />

The Data Signal Modulator (DSM) allows the user to mix a digital data stream (the “modulator<br />

signal”) with a carrier signal to produce a modulated output. Both the carrier and the modulator<br />

signals are supplied to the DSM module, either internally from the output of a peripheral, or<br />

externally through an input pin. The modulated output signal is generated by performing a<br />

logical AND operation of both the carrier and modulator signals and then it is provided to the<br />

MDOUT pin. Using this method, the DSM can generate the following types of key modulation<br />

schemes:<br />

<br />

<br />

Frequency Shift Keying (FSK)<br />

Phase Shift Keying (PSK)<br />

51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!