16F877 USART FOR MIDI SEND

Status
Not open for further replies.

Bear

New Member
hi,

I am attempting to send midi bytes from my PIC, although i think my code is right, there is no luck. I have tried different codes but still, it won't work.

my clock is 10MHz, and the code is;

list p=16f877
include "p16f877.inc"

dcount equ 20h

org 000h
goto main

del movlw D'255'
movwf dcount
dloop2 decfsz dcount
goto dloop2

main bsf STATUS,RP0 ;
movlw d'4' ; value for the BRG
movwf SPBRG ; init BRG 31250 bauds
bcf TXSTA,SYNC
bcf STATUS,RP0 ; come back to bank0
bsf TXSTA, TXEN
MOVLW 90H
MOVF TXREG
goto del
END

Any help is much appreciated
cheers.
 
well, sorry, but no real help here.

Still no luck.

How should i set up the usart to transmit and 31.25kbit/s, eight bit word with a 0 start bit and a 1 stop bit. this should be straight forward, no?

I hope someone can help here,

Thanks,

Bear
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…