[PD-dev] small gizmos

cyrille henry cyrille.henry at la-kitchen.fr
Thu Aug 26 14:53:25 CEST 2004


hello,

Tom Schouten wrote:

 >
 >>Sounds great Tom. I'd be glad to help out with the hardware, or some PIC
 >>assembly code when it comes time.
 >
 >
 > you by chance don't have some midi handling uart code for the 18f452 
lying
 > around? just midi in and out. something like that could serve as the guts
 > for a very tiny interpreter to get it bootstrapped.
 >

this is a cut and past from code made for 16F87x
i think this should be compatible for 18Fxxx... (???)

on this exemple receving is not made by interuption, so you have to pool
the rcv subroutine.
i hope you'll understand my french comment.

this is just sending and receving midi bytes and not messages.

fell free to ask me question about pic (never used 18F, but I used 16F a
lot)

I also can help for the hardware part, pcb and maybe some asm.

Cyrille


initialisation
;---------------	; configuration du port TX / RX
		BSF		STATUS, RP0		
	; select bank1
		bsf		TRISC, 7
		bsf		TRISC, 6		
	; pour permettre l'utilisation de ces pattes par l'USART

		movlw		.39			
		movwf		SPBRG			
	; initialisation de la frequence

		movlw		b'00100100'
		movwf		TXSTA			
	; initialisation du port TX

		BCF		STATUS, RP0		
	; select bankO

		movlw		b'10010000'
		movwf		RCSTA			
	; mise en route du port serie

		movf		RCREG, W		
		movf		RCREG, W		
	; purge du buffer de reception serie


;------------------------------------------------------------

snd

; envoie le mot 8 bits de W en midi
; utilise le port TX du Pross

rgstr_plein
		btfss		PIR1, TXIF
		goto		rgstr_plein		
	; le registre d'envoie est plein, il faut attendre
		movwf		TXREG			
	; on charge la valeur a envoyer ds le bon registre

		return					
	; c'est deja fini !

;------------------------------------------------------------
rcv
		btfsc		PIR1, RCIF		
	; test de presence de message ds le buffer de reception
		goto		rcv2			
	; appelle du traitement de reception d'un message
		movlw		.0			
	; w=0 qd le buffer de reception est vide
		return

rcv2
		movf		RCREG, W		
	; on met dans W le message reçu
		movwf		midi_oct		
	; on le sauve pour le traitrer
		movlw		.1			
	; w=1 ->buffer plein
		return



> 
>>I could also design a printed circuit
>>board if it helps.
> 
> 
> alright. a standard board included in the package :)
> 
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev
> 
> 







More information about the Pd-dev mailing list