Tuesday, September 28, 2010

Motorola 325i Drivers

new Poetry Video Cell



video blog from the poetry of absolute
http://www.absolutepoetry.org/-Poetry- Video-Cell-

Salutoni :-)

Monday, September 6, 2010

How To Build An Arrow Spine Tester

AVR timers in five minutes - to generate waveforms (with PWM mode to correct for phase and frequency)



pwm1.zip

CTC mode allows you to generate rectangular waveform, but only symmetrical (equal time on or off duty cycle to 50%). rectangular waveforms with duty cycle other than 50% can be generated with a different operating mode of the timer: the PWM.

On Timer1 can use three types of PWM:

1) Fast
2) A phase correction

3) A correction phase and frequency. The


1) is the fastest, you can reach higher frequencies of the remaining two, varying the duty cycle period (or frequency) remains constant, but varies the phase, the
2) and 3), however, does not entail a change of phase with the variation of duty cycle and thus are suitable for applications such as driving motors, where they do not require high operating frequencies but the phase must remain constant. An example, he sees the FastPWM used, could be the following: Generate
, with the 16 bit timer1 from the back edge square wave signal (dc = 25%) having a frequency of 1 kHz, using as a clock to system (fc = 4MHz):



V (OUT) 5V
_________ _________

fixed, then the timer counts from 0 to a number N equal to 2 n

-1:
 
N = 255 (8bit),
N = 511 (9bit)
N = 1023 (10bit) The

duration of the period Ts depends on these values, the clock period, the prescaler, in the familiar formula already seen:






Ts = Tc * k * (N +1) With our frequency fc of 4MHz (Tc = 0.25 us) for various values \u200b\u200bof the prescaler, we obtain the following TS values \u200b\u200b(expressed in ms) for the various resolutions of the fixed timer:



 

How
can be easily ascertained, have no value Ts = 1ms. Only N = 511 (9bit) and Prescaler 8 we get closer to 1ms (1.024 ms). If precision is not required
 push, we could then "settle" for a value almost equal to that assigned and configure timer1 so FastPWM resolution fixed 9bit. 

Assuming, however, you want an exact value of the signal period equal to 1ms, then we must resort to
variable resolution. Set the mode PWM controller with variable resolution determines the resolution between 2-bit (so the timer counts up to N = 3) and the maximum allowed by the timer: 16bit in the case of Timer1 (and therefore counts up to N = 65535).
So, ultimately, if we set the variable resolution value N can be chosen between 3 and 65535.
 What is a possible value of N for Ts = 1 ms, we obtain from the inverse formula: 





N = [Ts / (k * Tc)] - 1


For k = 1, 8, 64, 256, 1024, and Ts = 0.25 us (fc = 4MHz), substituting, we have:


----------
N 65535. We use



k = 1 (no prescaler) and therefore N = 3999


This value is loaded into the register ICR1
(



1).
defined the necessary number for the whole period Ts, now remains to determine the number (including in this case between 0 and 3999) at which you have the switching pin (or OC1A OC1B) where Ton = 0, 25ms.
If we create our waveform using the channel A, then the output signal on pin OC1A, we will load this value in the register OCR1A, conversely, if we use the channel B, then the waveform on pin OC1B, upload this value in the register OCR1B.
Supponendo di volere usare il canale A, la situazione è raffigurata di seguito:


  



 Finché il dato del timer1 (ovvero il valore del registro TCNT1) è inferiore al numero NA, l'uscita OC1A assume valore alto (5V). Allorquando il valore di TCNT1 eguaglia quello contenuto nel registro OCR1A, al successivo impulso di clock si ha una commutazione del pin OC1A a 0V. Infine, al raggiungimento del successivo valore N, il pin OC1A commuta a 5V.     
Da precisare che questa è la modalità non invertente
. E' possibile configurare la generazione della forma d'onda anche in modalità invertente, per la quale, ovviamente, switching levels are inverted and then invert the waveform. remains to determine the number of NA at the time which has elapsed since the last reset Timer1 is precisely Ton.
It 's very simple. If

to employ a time Ts, the timer must count to N, evidently for a time Ton smaller the timer will count to a number NA \u0026lt;N:
(NA+1) * Tc * k
mentre per il periodo Ts, già si è visto che: Ts = (N+1) * Tc * k
Facendo il  rapporto Ton/Ts ricaviamo il duty cicle e da qui il numero NA:
NA = [ d.c. * (N +1) ] -1 Nel nostro caso, essendo
d.c.=0,25 e N=3999 , ricaviamo NA=999
Abbiamo tutti i dati per scrivere il software, ma prima, ovviamente, scriviamo un possibile pseudocodice:

Imposta PB1 come pin d'uscita; Carica 3999 nel registro ICR1; Carica 999 in the register OCR1A;
FastPWM Sets mode with variable resolution (and value defined in ICR1 N);
Set waveform is not inverted;
Set prescaler: 1 (No prescaling)
Loading a value of register (with avr-libc) is trivial and needs no explanation, because already seen.

dell'ATmega168 Using the datasheet, you go to see what configuration registers of TIMER1 act and which bits to set, to obtain the desired settings.

FastPWM mode with variable resolution (and the value is defined in ICR1 N) is implemented by activating bit WGM13, WGM12 and WGM11, as described in Table 15-4 of d / sheet (as n. 14):
WGM13 and WGM12 bits are in the second configuration register: TCCR1B, while the remaining WGM11 bit found in the first configuration register TCCR1A. So we write:


TCCR1B
................................................. ..............................
0 0 Other use of pin OC1A/OC1B (no PWM)
0 1 Other use or just OC1A (see d / sheet) 1 0 1 1 a non-inverting mode inverting

So, we will activate only bit COM1A1 :
TCCR1A
TCCR1B WGM12);
// FastPWM con ICR1=N (Tab.15-4)
The simulation results are shown below. In the Annex the zip with all files of the project VMLAB. To use Linux VMLAB follow the tutorial on



Measurement Ton (0.25 ms)

measure Ts (1ms)







NOTES
-----------------------

1) Alternatively you can use the Register OCR1A (see d / sheet)



Sunday, September 5, 2010

Lumineyes Colour Change

AVR timers in five minutes - to generate waveforms (with how fast PWM) timers

quadra.zip

 
We have the following task:



generate, with the 16 bit timer1 by a symmetrical square wave signal (DC = 50%) having a frequency of 1 kHz, using as a system clock to fc = 4MHz


The switching of the logic level of an output pin , at regular intervals, can be seen as a square wave:


V (OUT)

5V
____________ ____________
T T

AVR (così come con altri micro) è possibile effettuare la commutazione del livello di uscita, non solo via software come si è fatto nella I parte (mediante un interrupt e un'operazione di ex-or) ma anche completamente via hardware, con tutti i vantaggi del caso. Se, quindi, il nostro compito è semplicemente quello di commutare il livello di un piedino di uscita a intervalli di tempo regolari ovvero, in altre parole,
generare un'onda quadra simmetrica
è preferibile utilizzare sempre il modo CTC già visto, ma con un meccanismo hardware invece di uno software. Nel modo CTC con meccanismo hardware non ci sono interrupt e relative routine di gestione da write software; CTC mode does do the job: when the data contained in the register of timer1 TCNT1 equals that of register OCR1A

(1)

, the next clock pulse is to reset the timer.

What changes is what to do if necessary zeroing: do not use more than one interrupt, but is (entirely in hardware) a switching of the logic level of a particular output pin called OC1A or, if configured differently our software, as we shall see, the zero point (Vout = 0V) or activation of the output (Vout = 5V).

Unlike the "software mechanism, which uses an interrupt, where you are free to choose not only what to do every T seconds, but the leg on which have switched, so using the CTC with the hardware mechanism is required to use a specific pin, shown in the datasheet with the reference OC1A (which just happened in their match ATmegax8 with PB1):


The signal period is



Ts = 1 / f = 1ms

T = Ts / 2 = 0.5ms

calculate the number N be loaded into the register
OCR1A
for different prescaling values: 1, 8, 64, 256 or 1024 through la nota formula:






  

k



N



1
1999
8
249 64
30,25



256

6,8125
0,9531



A questo punto prendiamo in considerazione solo fattori di prescaler per i quali abbiamo numeri N rappresentabili dal timer a 16 bit (numeri interi e non superiori a 65535), quindi scartiamo da subito k=64, k=256 e k=1024.

Rimangono infine k=1 e k=8, dei due preferiamo il più piccolo (nessun prescaler) in corrispondenza del quale
N=1999
.

Scriviamo il pseudocodice:


Imposta modo CTC (con confronto sul registro OCR1A) sul Timer1;
Carica OCR1A con il valore 1999;
 Imposta la commutazione hardware del pin OC1A all'azzeramento del timer (un clock dopo 1999) 
Imposta prescaler a 1 (nessun prescaler);


L'impostazione della commutazione hardware, avviene impostando i bit
COM1A1
e
COM1A0
del registro
TCCR1A
, che definiscono "cosa fare" sull'azzeramento
del timer: 1) switch the output, 2) reset the output, 3) set the output
COM1A1 COM1A0
Description --------------------- -------------------------------------------------- ------
0 0 Default: use the leg normally OC1A (such as input / output)
0 1 Switches the pin OC1A (0V-> 5V, 5V-> 0V) 1 0 Reset pin OC1A (0V) 1 1
Set OC1A pin (5V)


That in avr-libc code becomes:

TCCR1A COM1A0 ) ;
/ / Set up Toogle OC1A



For k = 1, from the table in datasheet dell'Atmega8, we get that we need only turn on the CS10 bit register TCCR1B:
 






TCCR1B

\u0026lt;

avr / io.h

>

 
int main


(
 

void) {






 DDRB = 

(

1
 
\u0026lt;

\u0026lt;

PB1)
 ;   / / Set the pin PB1 (OC1A) as output    TCCR1B   so CTC (on OCR1A)    OCR1A 
=

1999; / / load register 1999 in OCR1A
TCCR1A
on, the timer is started!



while

(

1)



{/ * do nothing ... resetting the timer (after 1999) will be switching hardware OC1A * /



}}


simulate vmlab with our software (as explained above) and the result is just a square wave of 1kHz.





To measure the frequency, click on the track and then click Analyze
. In

zip attachment, in addition to the source, there is also a project file (QUADRA.PRJ) for VMLAB.
----
Note 1) E 'can be used as an alternative to OCR1A register, the register ICR1 (see datasheet for the different configuration)

Green Loose Stools While Pregnant

Here Installation

here shooting INTANGIBLE WORKERS # 01
for Lucca In Fair



seems that DJs do the wedding guests dancing ... two situations are actually distant in time and space, but close in the imagination of immaterial labor, one of the most important economic machinery of the contemporary world.
are workers who are consumers or the celebrated dance that move the hands of the workers? Who's in and who the activity? Who is having fun and who is struggling? And work should only be alienation, suffering, resignation, or can 'and should be a party, light as a bridal veil?

Friday, September 3, 2010

Lcd Tv Keeps Turning Off

140 - After The Last 3

prejudice to everybody

returned from Barcelona, \u200b\u200bwhere I made the "smart holiday" :-)
as evidenced in part you can see the video on my YouTube channel
and accessible from the post prior to this ..... ricomiciamo to "work"

this September I will be 'just around.
continue to work here in Lucca to the different performance and "wall works" that I sang.


For example, you could come see tomorrow
Fair Sept. 4 at Lucca In the video installation
"Immaterial Workers # 01"
http://www.verdegiac.org/videoinstallazioni/ ImmaterialWorkers01.html
that remains up until Sept. 14

Then the September 24th I will be 'in Sardinia in Oliena
for "Abbas" with the ensemble of Gavino Murgia

and September 30 to October 2 in Monfalcone
for the festival "Absolute [YOUNG] Poetry 2010"
http://www.absolutepoetry. org/Absolute-YOUNG-Poetry-2010, 2079



web Absolutepoetry
Meanwhile I started a videoblog with a video made in Catalonia
http://www. absolutepoetry.org / Rosa-On-the-wind-of-the-mark

for now I think everything,,,

Salutoni
and good return :-)

Giac