PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Switching inLVL register in EUSART |
Posted: Wed Mar 24, 2021 4:47 pm |
|
|
Bieli wrote: | I didn't find information how to change INLVL register in CCS. Any suggestion?
|
In the current version of the compiler, it has the set_input_level_x()
function, where 'x' is the port a, b, c, etc.
The CCS manual says:
Quote: |
Function:
These functions allow the I/O port Input Level Control (INLVLx) registers
to be set. Each bit in the value represents one pin. A 1 sets the
corresponding pin's input level to Schmitt Trigger (ST) level, and a 0 sets
the corresponding pin's input level to TTL level. |
If that's not supported in your version, then use this (for example):
Put this line above main():
Code: | #byte INLVLA = getenv("SFR:INLVLA") |
Then in main(), do this:
Code: | INLVLA = 0x01; // To set pin A0 to be a Schmitt Trigger input |
|
|