A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: Function create_function() is deprecated
Filename: geshi/geshi.php
Line Number: 4751
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
MPSTermin4 - mcpaste
// Lösung zur Aufgabe Termin4
// Aufgabe 4
//****************************
// Zeiger auf Peripherie
// Messen der aufgelegten Masse
//
// von: Manfred Pester
// vom: 06. August 2003
#include "../h/pio.h"
#include "../h/tc.h"
#include "../h/pmc.h"
// für die Initialisierung der Zähler
#define TC_INIT TC_CLKS_MCK2 | TC_LDBSTOP | TC_CAPT | TC_LDRA_RISING_EDGE | TC_LDRB_RISING_EDGE
// Teiler 32?
int MessungderMasse(void);
void PIO_Init(void)
{
StructPMC* pmcbase = PMC_BASE;
StructPIO* piobaseA = PIOA_BASE;
StructPIO* piobaseB = PIOB_BASE;
pmcbase->PMC_PCER = 0x6000; // PIOA, PIOB
piobaseA->PIO_PDR = 0x090; // p4 p7
}
void Timer_Init(void)
{
StructPMC* pmcbase = PMC_BASE;
StructTC* tcbase4 = TCB4_BASE;
StructTC* tcbase5 = TCB5_BASE;
pmcbase->PMC_PCER = 0x00f00; // Clock Timer5, Timer4 einschalten
// Timer4:
tcbase4->TC_CCR = TC_CLKDIS; // CCR= CounterControlRegister; TC_CLKDIS=0x2
tcbase4->TC_CMR = TC_INIT; // Timer Counter Mode Register
tcbase4->TC_CCR = TC_CLKEN; // 0x1
tcbase4->TC_CCR = TC_SWTRG; // 0x4
// Timer5:
tcbase5->TC_CCR = TC_CLKDIS; // CCR= CounterControlRegister; TC_CLKDIS=0x2
tcbase5->TC_CMR = TC_INIT; // Timer Counter Mode Register
tcbase5->TC_CCR = TC_CLKEN; // 0x1
tcbase5->TC_CCR = TC_SWTRG; // 0x4
}
int main(void)
{
StructPIO* piobaseB = PIOB_BASE;
volatile int Masse = 0;
PIO_Init();
Timer_Init();
int i=0;
while(i < 4){
Masse = Masse + MessungderMasse();
i++;
}
Masse = Masse >> 2;
return 0;
}
int MessungderMasse(void){
StructPMC* pmcbase = PMC_BASE;
StructPIO* piobaseA = PIOA_BASE;
StructPIO* piobaseB = PIOB_BASE;
StructTC* tcbase4 = TCB4_BASE;
StructTC* tcbase5 = TCB5_BASE;
volatile int captureRA1;
volatile int captureRB1;
volatile int capturediff1;
volatile float Periodendauer1;
volatile int captureRA2;
volatile int captureRB2;
volatile int capturediff2;
volatile float Periodendauer2;
// Periodendauer der Waagensignale messen
// Signal an TIOA4 ca. 16kHz entspricht ca. einer Periodendauer von 62,5us
// durch den Teiler von 32 ergeben sich ca. 2ms
// Zähler mit positiver Flanke starten
tcbase4->TC_CCR = TC_SWTRG;
tcbase5->TC_CCR = TC_SWTRG;
while (!( tcbase4->TC_SR & 0x40)); // Capture Register B wurde geladen (RB Loading Status) Messung abgeschlossen
captureRA1 = tcbase4->TC_RA; // Speichert TC_RA (1. Gemesser wert) in Variable
captureRB1 = tcbase4->TC_RB;
while (!( tcbase5->TC_SR & 0x40)); // Capture Register B wurde geladen (Messung abgeschlossen
captureRA2 = tcbase5->TC_RA;
captureRB2 = tcbase5->TC_RB;
capturediff2 = captureRB2 - captureRA2;
Periodendauer2 = capturediff2; // Zeit in us
capturediff1 = captureRB1 - captureRA1;
Periodendauer1 = capturediff1; // Zeit in us
volatile int masse;
volatile int C1 = 2000;
volatile int C2 = 0;
masse = (C1 * ((Periodendauer1/Periodendauer2)-1))-C2;
return masse;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876