https://picload.org/image...pdr/uart_pic10f200.png"> https://picload.org/image...pdr/uart_pic10f200.png"> https://picload.org/image...pdr/uart_pic10f200.png">
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]#include <p10f200.inc> __CONFIG _WDTE_OFF & _CP_OFF & _MCLRE_ON tmp1 EQU 10h tmp2 EQU 11h org 0x00 movlw 0FFh movwf GPIO movlw 00h tris 6 main movlw 0A5h movwf tmp1 movlw 08h movwf tmp2 bcf GPIO,1 ;Start bit call TransmitByte bsf GPIO,1 ;Stop bit goto main TransmitByte: 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' btfsc STATUS,C bsf GPIO,1 ;turn pin to '1' if carry = '1' decfsz tmp2 ;decrement loop variable goto sr retlw 0 END[/code] This code above looks like this:

https://picload.org/image...pdr/uart_pic10f200.png


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir