| Electronic Components Datasheet Search |
|
PFS122 Datasheet(PDF) 82 Page - PADAUK Technology. |
|
|
|||||||||||||||||||||||||||||
PFS122 Datasheet(HTML) 82 Page - PADAUK Technology. |
|
82 / 93 page ![]() PFS122 8bit MTP MCU with 12-bit R-Type ADC ©Copyright 2020, PADAUK Technology Co. Ltd Page 82 of 93 PDK-DS-PFS122-EN_V000-May 28, 2020 7.5. Bit Operation Instructions set0 IO.n Set bit n of IO port to low Example: set0 pa.5 ; Result: set bit 5 of port A to low Affected flags: 『N』Z 『N』C 『N』AC 『N』OV set1 IO.n Set bit n of IO port to high Example: set1 pb.5 ; Result: set bit 5 of port B to high Affected flags: 『N』Z 『N』C 『N』AC 『N』OV swapc IO.n Swap the nth bit of IO port with carry bit Example: swapc IO.0; Result: C ← IO.0 , IO.0 ← C When IO.0 is a port to output pin, carry C will be sent to IO.0; When IO.0 is a port from input pin, IO.0 will be sent to carry C; Affected flags: 『N』Z 『Y』C 『N』AC 『N』OV Application Example1 (serial output) : ------------------------------------------------------------------------------------------------------------------------ ... set1 pac.0 ; // set PA.0 as output ... set0 flag.1 ; // C=0 swapc pa.0 ; // move C to PA.0 (bit operation), PA.0=0 set1 flag.1 ; // C=1 swapc pa.0 ; // move C to PA.0 (bit operation), PA.0=1 ... ------------------------------------------------------------------------------------------------------------------------ Application Example2 (serial input) : ------------------------------------------------------------------------------------------------------------------------ ... set0 pac.0 ; // set PA.0 as input ... swapc pa.0 ; // read PA.0 to C (bit operation) src a ; // shift C to bit 7 of ACC swapc pa.0 ; // read PA.0 to C (bit operation) src a ; // shift new C to bit 7, old C ... ------------------------------------------------------------------------------------------------------------------------ set0 M.n Set bit n of memory to low Example: set0 MEM.5 ; Result: set bit 5 of MEM to low Affected flags: 『N』Z 『N』C 『N』AC 『N』OV set1 M.n Set bit n of memory to high Example: set1 MEM.5 ; Result: set bit 5 of MEM to high Affected flags: 『N』Z 『N』C 『N』AC 『N』OV |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |