Beste Forummers,

Ik ben voor Martin Lightjockey een interface aan het maken zodat ik de software kan aansturen met een hardware matig knoppen paneel. Nu is de sofware er voor er al: Klik.
In het programma wordt gesproken over een B1 B2 en B3 waarde. Dit lijken me standaard termen van RS232 alleen ik weet niet hoe ik ze kan versturen met een PIC.

Iemand een idee?

Ik kan je wel vertellen dat B1 / B3 niets met RS232 te maken hebben. Wellicht worden ze in de contexct van waar jij het gebruikt voor een protocol gebruikt, maar RS232 is alleen een hardware spec, dus (software)protocollen vallen daarbuiten. Zoek het toch eens meer in de hoek van DMX.

Op 4 februari 2006 07:35:23 schreef Marco69:
Ik kan je wel vertellen dat B1 / B3 niets met RS232 te maken hebben. Wellicht worden ze in de contexct van waar jij het gebruikt voor een protocol gebruikt, maar RS232 is alleen een hardware spec, dus (software)protocollen vallen daarbuiten. Zoek het toch eens meer in de hoek van DMX.

Ik kan je vertellen dat het hier niks met DMX te maken heeft. Het gebruik van RS232 is hier tussen de PC en een knoppenpaneel (Input dus) Maar toch bedankt!

Kan je iets meer informatie geven ?
Wat wil je precies, wat lukt wel en wat niet ect..

Ik heb dit gevonden nu:

Before the interface can be RS-232 settings to be used must be determined. Click on the Setup menu to set the RS-232 settings.
Select COM Port from 1 through 4 and one of the possible Baud-Rates. The data format is fixed at 8 databytes, 1 stop byte and no parity.

RS-232 Protocol

The RS-232 protocol is based on a 3 byte binary protocol.
The format for all commands are identical:
[Command] [Data1 (MSB)] [Data2 (LSB)]

All 3 bytes must be sent to LightJockey within 0.2 seconds, otherwise an incomplete command times out.

All bytes with a value of 128 or above are treated as a [command] byte. Consequently all data bytes must have a value of 127 or lower. When the both the data bytes are used to send a value the value must be split into an MSB and an LSB pair.

Examples:

To Load cue number 130:
Send [129] [1] [2] - 129 is the Load Cue command, and 1*128+2 selects cue number 130.

To Load Cuelist number 2:
Send [128] [0] [2] - 128 is the Load Cuelist command, and 0*128+2 selects cuelist number 2.

Listed below are the various commands accepted by the RS-232 interface.

Het probleem is alleen dat ik geen idee heb hoe ik deze data verstuur met een PIC over een COM poort

Heb je al een PIC met USart poort en een MAX232 ?

Op 4 februari 2006 12:54:58 schreef MMSoft:
Heb je al een PIC met USart poort en een MAX232 ?

PIC877A icm met een MAX232 ja. Het probleem is dat ik echt maar een redelijk beginner ben kwa PICs

Als eerste moet je de baudrate instellen
Afhankelijk van je kloksnelheid !

Hier een voorbeeldje:


;** SET BAUD RATE TO COMMUNICATE WITH PC  **************************************
; Boot Baud Rate = 9600, No Parity, 1 Stop Bit 
                movlw       0x19            ;0x19=9600 bps (0x0C=19200 bps) 
                movwf       SPBRG           ;
                movlw       B'00100100'     ;brgh = high (2) 
                movwf       TXSTA           ;enable Async Transmission, set brgh 
                                            ;
                bcf         STATUS,RP0      ; RAM PAGE 0 
                                            ;
                movlw       B'10010000'     ; enable Async Reception 
                movwf       RCSTA           ;