You can post your problem related to PIC Microcontroller Projects here. We will try our best to help you out.
- Joined:Sat Feb 18, 2017 5:48 am
PIC10F200 - Software UART
I would like to write a software transmitter UART for the PIC10F200, the only problem is: It doesn't have a timer overflow interrupt. I don't know how i could manage that every pin toggle takes exactly the same time. My current approach looks like this:
Code: Select all
__CONFIG _WDTE_OFF & _CP_OFF & _MCLRE_ON
tmp1 EQU 10h
tmp2 EQU 11h
main movlw 0A5h
bcf GPIO,1 ;Start bit
bsf GPIO,1 ;Stop bit
sr rlf tmp1,f ;shift tmp1 to the left (affects carry bit)
btfss STATUS,C ;check carry
bcf GPIO,1 ;turn pin to '0' if carry = '0'
bsf GPIO,1 ;turn pin to '1' if carry = '1'
decfsz tmp2 ;decrement loop variable
This code above looks like this:
- Site Admin
- Joined:Tue Feb 07, 2017 12:51 pm
Bro give some more details about the project and as the software UART is concerned, that's quite easy in PIC Microcontroller, you just specify the pins on which you wanna o the software serial and rest is done by the compiler. I would suggest you to use MikroC Pro For PIC. They have given Examples in their knowledge base.