Für dieses Forum muß Javascript im Browser aktiviert werden!
Kommentar: Einfügen von HTML im Kommentar: Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a> Bild einfügen: <img src="BILDURL"> Text formatieren: <b>fetter Text</b> <i>kursiver Text</i> <u>unterstrichener Text</u> Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b> C2 Quellcode formatieren: <code>Quellcode</code> ASM Quellcode formatieren: <asm>Quellcode</asm> (Innerhalb eines Quellcodeabschnitts ist kein html möglich.) Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst ! > Hello everybody: > I have a C-Control II Station and written this file for a proto type machine ( suspension movments) > the following programme in C2 according to the appropriate tools. However, it is way too slow and > I cannot get to work the interrupts. (See the blocked section). > I know assembler (8051) fairly well and I want to know if somebody can help me get started to > transfer this programme in assembler C164. > > //------------ > thread main > //------------ > { > byte i,f ; > int x,m[210] ; > string s,output ; > station_lcd.init(); > station_io.init(); > hwcom.init(); > hwcom.setspeed(5); > plm.settimebase(0, 1); > plm.setperiod(0, 999); > station_lcd.cursorpos(1,0); > output = "TEST UNIT"; > station_lcd.print(output); > output = "MODULE II"; > station_lcd.cursorpos(2,0); > station_lcd.print(output); > x = 0; > i = 0; > sleep 100; > loop > { > station_io.LEDoff(1); > station_io.LEDoff(2); > hwcom.receive(f,2,1); > if f > 100 // motor starts with speed data > { > station_io.RELon(1); > str.putint(s,f); > x = f ; > f = 0; > x = (x - 100)* 10; > } > if f == 63 // ? motor stop speed data 0 > { > f = 0; > x = 0; > station_io.RELoff(1); > } > if f == 64 // @ data to PC > for i= 0...200 > { > f = 0; > str.clear(s); > str.putint(s,m[i]); > hwcom.send(s,3); > hwcom.put(13); > hwcom.put(10); > hwcom.flush(); > } > //======================================================================== > if ports.get(8) == -1 // 1 puls per rpm from encoder A > { > station_io.LEDon(1); > i = 0; > wait ports.get(8) == 0; // wait for low > } > if ports.get(9) == -1 // 200 puls per rpm from encoder A = ca 1 kHz > { > wait ports.get(9) == 0; // wait for low > i = i+1; > station_io.LEDon(2); > m[i] = ports.adc(0); > } > //========================================================================= > plm.out(0,x); // motor speed duty cycle to 99 % > } > > Thanks, Bram >