Tuesday, 20 March 2018

8 LED shift register -arduino 74HC595

 A brief exercise using the 74HC595 Serial to Parallel Converter..
It's a shift register.
This chip has 8 outputs and 3 inputs.
The 74HC/HCT595 is a high-speed Si-gate CMOS device.
 
I remember building a Video synth module a few years ago that also used a shift register.
The Castle used a 4 bit module.... the CD4015
 
This 74HC595 is 8-bit. 
It's a 16 pin chip.
It's all digital  Designed to store 0's and 1's, not analog voltages.
So shouldn't be confused with synthesizer ASRs - analog shift registers (though the idea is the same).
 
Shift registers are basically  memory modules.
 
 
It's useful if you run out of pins on your Arduino.
The 74HC595 will help you make use of the pins you have .
You can even link multiple shift registers together to extend your output even more. 
 Most of the outputs pins are on the left. Inputs on the right. (fig 1)

Here is the data sheet.

The Data sheet describes it as a  8-stage serial shift register with a storage register and 3-state outputs. 
The shift register and storage register have separate clocks
What it does is take data from your Arduino ,& momentary store it, freeing up the pins for new data.
 
The inputs are:
MR (SRCLR) - pin 10 
SHcp - Shift Register clock - pin 11
STcp - Clock (RCLK) - pin 12 - storage register clock (LATCH)
OE - pin 13 - output enable 
Ds/SER - serial input (pin 14)

Both the shift register clock (SRCLK) and storage register clock (RCLK) are positive-edge triggered.
Pin 14 is your important DATA input pin
Pin 11 is the Clock
Pin 12 is the Latch
 
This is a good circuit diagram:

Q0 to Q7 & Q15, are the outputs
 
 
Connect ground & voltage (pins 8 & 16)

We are using digital pins 4, 5, 6.
The important connections are
  • Digital 4 from the arduino goes to pin #14 of the shift register (DATA)
  • Digital 5 from the arduino goes to pin #12 of the shift register (LATCH)
  • Digital 6 from the arduino goes to pin #11 of the shift register (CLOCK)

 The anodes of the LEDs connect via 270 ohm resistors to pins:15, 1, 2, 3, 4, 5, 6, 7.

On the LEDs, the cathode is connected to ground

Note:

Pin 13 is the output enable.
You could attach this to a PWM capable Arduino pin and use 'analogWrite' to control the brightness of the LEDs. At the moment, we need to attach it to ground. 
 
MR must also be connected to 5V

--------------------------------



Code 1

--------------------------------------------

 /*
    Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
    */
     // declare your variables
     // these are the pins attached to the clock,latch &
     //data inputs
    int latchPin = 5;
    int clockPin = 6;
    int dataPin = 4;

    int delayTime = 500;

   /*  used to hold the pattern of which LEDs are currently
   turned on or off.
     Data of type 'byte' represents numbers using eight bits.
    */
    byte leds = 0;
     
    void setup()
    {
      pinMode(latchPin, OUTPUT);
      pinMode(dataPin, OUTPUT);  
      pinMode(clockPin, OUTPUT);
    }
     
    void loop()
    {
      leds = 0;
      updateShiftRegister();
      delay(delayTime);
      for (int i = 0; i < 8; i++)
      {
        bitSet(leds, i);
        updateShiftRegister();
        delay(delayTime);
      }
    }
     /*
     the actual data to be shifted into the shift register,
     which in this case is 'leds'.
     */
    void updateShiftRegister()
    {
       digitalWrite(latchPin, LOW);
       shiftOut(dataPin, clockPin, LSBFIRST, leds);
       digitalWrite(latchPin, HIGH);
    }

-------------------------------------------------------------------

 ---------------------------------
-------------------------------------


Monday, 19 March 2018

Mutant Bassdrum - Hexinverter

Some picks of this great module i just finished building.

These aren't really build notes but I hope it will help others in their quest to build one of these.
Its not a difficult build at all.
All through hole components.

There are 2 PCBs. ... this is the lower.
The upper PCB holds the LEDs, pots etc.



Below are pics of the build process... working backwards.


 Be careful with the orientation of the vactrol.


Now I want to build all the drum modules. :-)

LINKS:
hEXINVERTER

-----------------------------------------------------------------------------------------------
For more Euro DIY builds click here:
http://djjondent.blogspot.com.au/2017/12/diy-index.html
------------------------------------------------------------------------------------------------- 

Sunday, 18 March 2018

Arduino - Print Commands and the Serial Port

All Arduino boards have at least one serial port (also known as a UART or USART)
It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB
 
You can use the Arduino environment’s built-in serial monitor to communicate with an Arduino board. Click the serial monitor button in the toolbar and select the same baud rate used in the call to begin().
Serial communication on pins TX/RX uses TTL logic levels (5V or 3.3V depending on the board).
 
The Print command allows us to read info from the Arduino.
   
The Syntax is
Serial.print ()

Serial.print("Hello world.") gives "Hello world."
Serial.print(78) gives "78"
 
This command prints data to the serial port as human-readable ASCII text.
 
An optional second parameter specifies the base (format) to use
ie
permitted values are BIN(binary, or base 2),  
Serial.print(78, BIN) gives "1001110"
 
OCT(octal, or base 8),  
Serial.print(78, OCT) gives "116"
 
DEC(decimal, or base 10),  
Serial.print(78, DEC) gives "78"
 
HEX(hexadecimal, or base 16).
Serial.print(78, HEX) gives "4E"
 
------------
code 1



------------------
// variables
int j=1;
int waitT=300; //delay

void setup()
{
Serial.begin (9600);
  //baud rate
    // this sets up the serial monitor
}

void loop()
{
 Serial.print(j);
  j=j+1;
    delay(waitT);
}
-----------------------------------------------------
code 2


This is really poor programming, as it's printing across the page.
 
the fix is easy
Add "ln"
 Serial.println(j); 















code 3

// variables
int j=1;
int waitT=300; //delay
String myString="j = ";

void setup()
{
Serial.begin (9600);
  //baud rate. Use higher baud rates to make it run faster.
    // this sets up the serial monitor
}

void loop()
{
 Serial.print(myString);
 Serial.println(j); // adding ln ... prints to a new line
  j=j+1;
    delay(waitT);
}

-------------------------------------------------------------------

code 4

// variables
int j=1;
int waitT=300; //delay
int x=3;
int y=7;
int z;
String myString=" + ";

void setup()
{
Serial.begin (9600);
  //baud rate. Use higher baud rates to make it run faster.
    // this sets up the serial monitor
}

void loop()
{
  z=x+y;
  Serial.print(x);
  Serial.print(myString);
  Serial.print(y);
  Serial.print(" = "); // the quotes make it print =
  Serial.println(z);
}

------------------------------------------------------------------------
 ---------------------------------
-------------------------------------

Friday, 16 March 2018

The Stars My Destination - Alfred Bester

 


Its first publication was in book form in June 1956 in the United Kingdom, where it was titled Tiger! Tiger!, named after William Blake's 1794 poem "The Tyger",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 It was serialized in Galaxy magazine in four parts beginning with the October 1956 issue
 

 
 

 This is the 1957 edition 
March 21, 1957
US version
Signet Books
Paperback













Wednesday, 14 March 2018

Arduino Index

 Index for all things Arduino
 
+ Momentary push buttons & Pull down resistors
+ analogRead command  
 
 
 
 
 
 
+ Tone() function - adding noise  
+ Functions - general - creating new functions, etc
 
 
+ i2c LCD Timer - stopwatch 
 
 
+ millis() function - blinking 1 LED

Monday, 12 March 2018

Modular on the Lounge - second meeting

A great night had by all.

Visuals were provided with a LZV Vidiot video synth

A post shared by jono (@dj_jondent) on
Sat 10th March.
Wollongong, Australia.

A post shared by jono (@dj_jondent) on
We will try to hold these events regularly ... every 2 to 3 months

Jerusalem - Mount of Olives Cemetery, Israel.

This is the most important cemetery in Jerusalem. It started during the first Temple period and It is still being used today.


The cemetery contains anywhere between 70,000 and 2 or 300,000 tombs

 During the First and Second Temple Periods the Jews of Jerusalem were buried in burial caves scattered on the slopes of the Mount, and from the 16th century the cemetery began to take its present shape.
(Wikipedia)

..: According to Jewish tradition, it is here that the Resurrection of the Dead would begin. The Messiah would appear on the Mount of Olives and head toward the Temple Mount.


 Ariel view

WikiAir IL-13-06 039 - Mount of Olives.JPG
By Neukoln, CC BY-SA 3.0, Link

For more travel postcards click here: