Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
projekte:cis:canon_mf4370dn [2016-06-15 02:14] – cracki | projekte:cis:canon_mf4370dn [2016-06-15 04:06] – [Pinout] cracki | ||
---|---|---|---|
Line 29: | Line 29: | ||
* 7 Startpuls | * 7 Startpuls | ||
* 8 Vref | * 8 Vref | ||
- | * 9 VCC (3.3V) | + | * 9 VCC (5V) |
* 10 GND | * 10 GND | ||
* 11 DPI (low: 300, high: 600, pullup) | * 11 DPI (low: 300, high: 600, pullup) | ||
* 12 Aout | * 12 Aout | ||
+ | * 2-4 V Ausgang, geht nie runter auf 0 | ||
+ | * regelmäßige blinde Flecke, ca 0.5mm breit jeweils | ||
+ | * doppelt so viele blinde Flecke, wenn Spannung an DPI > VCC | ||
===== Reversing ===== | ===== Reversing ===== | ||
Line 56: | Line 59: | ||
* 3 GND Gruen, ~3.45V 50mA | * 3 GND Gruen, ~3.45V 50mA | ||
* 4 GND Blau, ~3.45V 30mA | * 4 GND Blau, ~3.45V 30mA | ||
+ | |||
+ | bei ~4.5V Versorgung in die LEDs folgende Widerstände nach Erde: | ||
+ | * Rot: 220 | ||
+ | * Grün: 50 | ||
+ | * Blau: 100 | ||
Spannungen bei 1 mA: | Spannungen bei 1 mA: | ||
Line 68: | Line 76: | ||
| 12 | <typo bg:# | | 12 | <typo bg:# | ||
+ | ===== Arduino Code ===== | ||
+ | |||
+ | < | ||
+ | #define START 2 | ||
+ | #define CLOCK 3 | ||
+ | #define DPIMODE 4 | ||
+ | #define LEDR 5 | ||
+ | #define LEDG 6 | ||
+ | #define LEDB 7 | ||
+ | |||
+ | bool dpimode = 1; | ||
+ | uint16_t pixels = dpimode ? 5184 : 2592; | ||
+ | |||
+ | uint32_t linetime = 4000; // us | ||
+ | uint32_t sched = 0; | ||
+ | |||
+ | uint8_t lightcolor = 0; | ||
+ | |||
+ | void set_lighting(uint8_t active) | ||
+ | { | ||
+ | digitalWrite(LEDR, | ||
+ | digitalWrite(LEDG, | ||
+ | digitalWrite(LEDB, | ||
+ | } | ||
+ | |||
+ | void setup() { | ||
+ | pinMode(START, | ||
+ | pinMode(CLOCK, | ||
+ | pinMode(DPIMODE, | ||
+ | |||
+ | pinMode(LEDR, | ||
+ | pinMode(LEDG, | ||
+ | pinMode(LEDB, | ||
+ | |||
+ | digitalWrite(DPIMODE, | ||
+ | |||
+ | sched = micros(); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | | ||
+ | set_lighting(0); | ||
+ | |||
+ | digitalWrite(START, | ||
+ | digitalWrite(CLOCK, | ||
+ | digitalWrite(CLOCK, | ||
+ | digitalWrite(START, | ||
+ | |||
+ | set_lighting(1 << lightcolor); | ||
+ | |||
+ | for (uint16_t counter = 82 + pixels; counter-- > 0; ) | ||
+ | { | ||
+ | PORTD |= _BV(PORTD3); | ||
+ | PORTD &= ~_BV(PORTD3); | ||
+ | } | ||
+ | |||
+ | lightcolor = (lightcolor+1) % 3; | ||
+ | |||
+ | sched += linetime; | ||
+ | int32_t dt = sched - micros(); | ||
+ | while (dt > 0x4000) | ||
+ | { | ||
+ | delayMicroseconds(0x4000); | ||
+ | dt -= 0x4000; | ||
+ | } | ||
+ | if (dt > 0) | ||
+ | delayMicroseconds(dt); | ||
+ | } | ||
+ | </ |