Sub-station

ShIP to

Ansjer cctv English

超级快三跨度振幅走势彩经网:build your own (cheap!) multi-function wireless camera controller. - mini wireless camera

by:Ansjer cctv     2020-02-24
build your own (cheap!) multi-function wireless camera controller.  -  mini wireless camera
Have you ever thought about building your own camera controller?
Important: The capacitor of MAX619 is 470n or 0. 47u.
The schematic is correct, but the component list is wrongupdated.
This is the entry for the Digital Day contest, so please give/vote/comment favorable comments if you find it useful!
If you really like it and it's a stump, hit "I love it! " :)
Update: featured on hackaday! hackaday.
Com/2009/10/13/-different-breed-of-camera-
Controller/update: New photo of laser trigger action!
Update: First Prize = D Thanks for voting and/or rating!
This Instructure is mainly for the benefit of SLR users who want to get more mileage from the camera, but if there are points and shots of the infrared interface, you may find it interesting.
This will work, of course (
Modify it a little)
With the camera hack, you can connect the logic output to the camera trigger terminal.
This started as a full tutorial, but since I ran into some unexpected limitations later on, it might be more of a guide to how to get things done --
I often make you choose how to do things that I think are better than blindly saying "you have to do this.
Think of this as a lesson in camera controller design.
I provide the schematic and the full code so you can copy it at any time.
This will be a simple example for most people to transfer the design to a strip board and add an LCD.
I have discussed how to make a breadboard for it as the process is very similar and can correct the error before you permanently design it!
Features: single shooting mode interval (time lapse)
Mode trigger shooting (
External sensor trigger)
Including variable conditional modes for sensor design-light, sound (
More possibilities! )Total cost -under £25 (Tools not included)
LCD display for easy replacement with Nikon/Canon (coded)
Potential support (untested)
For the Olympus/PentaxNo firmware modification, IR is required, so it is both wireless and will not damage your camera, you have this after hours of cold clicking on my remote control outside
I'm doing an 8 second interval of about 1000 shots.
I guess, hey, it's just an IR LED, isn't it?
Why can't I just copy it and make my own remote with built-in latency?
Then I found out (
A little awkward because I thought I had a big brain wave.
This is done, and there are even a few notes on the topic.
My implementation, unlike most intervalometers and diy remotes, is that it allows a lot of customization and modularity, compatible with Nikon/Canon (
There may be others later)
And combines the ability to take pictures on a specific trigger.
The idea is simple.
You want to take a quick picture (
For me, currently limited by shutter delay 6 MS).
There are many ways to do this: 1.
Try it wrong, you try to take pictures at the right time.
Improved tried wrong, you black the room, put the camera on the bulb (open shutter)
And launch the flash at the right time.
Buy a dedicated trigger controller with some sort of audio/light sensor that can take a picture under command 4.
Build one yourself!
OK, 1 and 2 can have a good time and can produce some very good pictures.
But what I'm going to tell you is that it's possible to build a circuit that can give you consistent results over and over again.
Most importantly, the cost is lower than other models during these tight times (
Some people have already produced kits for doing this kind of thing, but they spend a lot of money.
The versatility of the design is this: if your sensor generates an output voltage between 0 and 5 v, you can use it to trigger your camera!
On the surface, this is a boring statement, but it becomes very powerful once you start to understand what it means.
By simply monitoring the voltage level, your trigger can be light-based (LDR), sound based (
Microphone or ultrasound)
Based on temperature (thermistor)
Even a simple potentiometer.
In fact, anything.
You can even connect the circuit to another controller and you can trigger from it as long as it can give you a logical output.
The only major limitation of the current design is that it only works with the IR interface, modifying the software and hardware to pass through the mini-
USB or any type of interface is required.
Note: Source code: I have provided some applications in Step 13.
So far, the code I'm running on the controller exists in a hex file along with the main c file and its dependencies.
You can simply run my code if you are not sure about compiling.
I also have some sample code that you can use in different steps (
They are obviously named remote _ test, intervalometer test, and adc test.
If I reference the code in one step, it is most likely that it is there.
Edit: Update about balloon pop-up-
When I said you could easily take a picture of a pop-up balloon, I seemed a little short-sighted.
It turns out that the skin on the average balloon travels so fast that it pops up completely when your camera triggers.
This is a problem with most cameras, not the controller (
Detect ADC at a rate of about 120 kHz).
The solution to this problem is to use the trigger flash, which works if you add an extra wire and another small circuit.
That is, in theory you can pop it up with something else and play the delay (
Even change the delay code to include microseconds).
Air particles of 1 m 150 MS-It takes about 6-
7 MS enough time to trigger and shoot.
Just move the gun to provide a basic delay of several milliseconds.
Sorry again, I will play tonight if I can get some balloons, but there are a lot of uses for audio triggers like fireworks!
I put a quick and dirty passage of time below to show that it works :)
Don't forget to read, rate and/or vote!
Cheers joshdiserin I'm not responsible for anything in case something terrible goes wrong or if you brick your camera/pick up your cat.
By starting a project based on this guidance sheet, you can accept this and continue at your own risk.
If you do one of these or use my instructions to help you --
Please send me a link/photo so I can include it here!
The response has been overwhelming so far (
At least by my standards)
So it would be great to see how people explain it.
I am modifying the second edition when I type; )
So how do we build this thing?
The core and soul of this project is a single chip microcomputer.
It is essentially a slightly trimmed chip used by Arduino, the atsp168.
It is programmable in C or assembly and has a variety of very useful features that we can take advantage.
"28 pins, most of which are input/output (i/o)
"On-board analog-to-digital converter" low power "3 On-board timers" internal or external clock sources "a large code base and an online sample with a large number of pins is good.
We can connect to the LCD screen with 6 button inputs and still have enough space left to shoot the IR LED and some status LED.
The Atmel series processors have a lot of support online, and there are many introductory tutorials (
I will discuss it briefly, but there are better dedicated tutorials)
There is also a bunch of code that needs to be considered carefully.
For reference, I will Code this project in C usingLibC library.
I could have easily done this using PIC, but with great support, all the examples I found for the remote are based!
The LCD display mainly has two display methods: Graphics and letter numbers.
The graphic display has resolution, and you can place pixels anytime, anywhere.
The disadvantage is that they are more difficult (
Although there is a library.
The alphanumeric display is only one or more lines of characters, and the LCD has on-board storage of basic characters (i. e.
Alphabet, some numbers and symbols)
It's relatively easy to output strings, etc.
The downside is that they are not as flexible and it is almost impossible to display the graphics, but it fits our purpose.
They are cheaper too!
Alphabetical numbers are sorted by row and column count.
2x16 is common, two lines of 16 characters, each of which is a 5x8 matrix.
You can get 2x20 s as well, but I don't see any need.
Buy anything you feel comfortable.
I choose to use a red backlight LCD (
I want to use it for space photography, the red light works better for night vision).
You can use no backlight-
It's your choice.
You save power and money if you choose a non-backlit route, but you may need to light the torch in the dark.
When looking for an LCD, you should make sure that it is controlled by hd44780.
This is an industry standard protocol developed by Hitachi. we can use a lot of good libraries to output data.
The model I bought is JHD162A from eBay.
The input will be completed by the button (simple! ). I chose 6 -
Mode selection, OK/shoot and 4 directions.
In the event of a crash, it is also worth getting another small button for resetting the microprocessor.
As for the trigger input, some basic ideas are light-dependent resistors or resident microphones.
Depending on your budget, this is where you can become creative or stingy.
Ultrasonic sensors will cost more and require some extra programming, but you can do something very neat with them.
Most people will be happy with the microphone (
Probably the most useful general purpose sensor)
And the voters are cheap.
Please note that itll also needs to be enlarged (
But I will discuss this later). Output -
The only real output we need is status (
Except display)
So several LEDs can work properly here. Output -
In order to take pictures, we need to interface with the camera. For this reason, we need a light source that can produce infrared light. red radiation.
Thankfully there are a lot of LEDs that can do this and you should try to pick up a fairly high power.
The current rating of the unit I selected is up to 100 mA (
About 30 mA of most LEDs).
You should also pay attention to the wavelength output.
Infrared is in the longer wavelength part of the EM spectrum and you should look for about 850-950nm.
Most infrared LEDs tend to the 950 end, and you may see the Redlight when it is turned on, which is not a problem, but it wastes the spectrum, so try to get close to 850 if possible.
How will we drive this all?
Well, it will be portable, so the battery!
I chose to use 2 AA batteries and then increase to 5 v.
In the next few sections I will discuss the reasoning behind this.
"Shell and construct" "It's entirely up to you how you do this.
I decided to use the stripboard to make the circuit after prototyping because it is cheap and flexible and saves the cost of designing a custom PCB.
I have provided the schematic so you are free to make your own PCB layout
Although I would appreciate having a copy if you did!
Again, this situation is entirely your choice and it needs to be able to adapt to the screen, buttons (
With a fairly intuitive layout if possible)
And the battery.
With the development of the circuit board, this is not complicated, many connections are simply connected to things like buttons/LCD.
Power management for projects like this is clear that portability should be a key aspect.
So the battery is the logical choice!
Now, it's quite critical for portable devices to choose a rechargeable or easily accessible battery source.
9 V PP3 batteries or AA batteries are the two main options.
I'm sure some people will think 9 v battery is the best option because hey, 9 v is better than 3, right?
Not in this case.
Although the 9 v battery is very useful, it generates voltage at the cost of battery life.
To mAh (milliamp hours)
, This rating theoretically tells you how long the battery will continue to run in 1 mA hours (
Despite the use of a little salt, these are usually under ideal low load conditions).
The higher the rating, the longer the battery lasts.
The rated capacity of the 9 v battery is up to about 1000 mAh.
On the other hand, alkaline AA is almost three times the original at 2900.
Although 2500 mAh is a reasonable quantity, NiMH rechargables can achieve this (
Please note that the rechargeable battery is at 1. 2V not 1. 5! ).
5 v input required for LCD screen (?10%)and the AVR (
Micro Controller)
The demand is roughly the same (
Although it can be as low as 2.
Clock speed for low frequency).
We also need a fairly stable voltage if the voltage fluctuates, which can cause problems with the micro-controller.
In order to do this, we will use the voltage regulator and you will now need to make a choice in terms of price and efficiency.
You can choose to use a simple 3-
Pin voltage regulator like LM7805 (
78 series, output 5 V)
Or small integrated circuits.
If you choose to use this option, you need to remember a few points.
First, the three pin regulators almost always need input higher than their output.
They then lower the voltage to the expected value.
The disadvantage is that they are very efficient (50-
Good 60%).
The good thing is that they are cheap and run with a 9 v battery and you can buy a basic model in the UK with 20 p.
You should also keep in mind that the regulator has a voltage drop-
Minimum gap between input and output.
You can buy special low voltage difference (Low DropOut)
Regulators with about 50 mV drop-outs (compared to 1-
2 v with other designs).
In other words, look for LDOs with 5 v output.
The ideal way to use an integrated circuit is a switch regulator.
For our purposes, these are usually 8-
Pin package with voltage and high efficiency to provide us with adjustable output-
Nearly 90% in some cases.
You can use a boost converter or a buck converter (
Boost/Buck, respectively)
Depending on what you want to enter, or you can purchase a regulator that is above or below the desired output.
The chip I use in this project is MAX619.
It is a 5 v boost regulator with 2 AA (
The input range is 2 v-3. 3V)
And give a stable 5 v output.
It takes only four capacitors to operate, and it saves a lot of space. Cost -?3.
00 including hat
It can be said that it is worth splurging just to use your battery more.
The only downside is that it has no short circuit protection, so please note if there is a surge in current!
However, it is rather trivial to fix with additional circuits: another useful chip design-
Although the solution for ltnz is not that simple.
Again, the 5 v regulator, but it can accept various inputs and has useful features such as low battery detection.
Using an inductor, a large capacitor, and a resistor, it costs almost £ 5.
We will use two main voltage rails (
Add a common ground).
The first is the 3 v of the battery, which will be used to power LEDs and other relatively high power components.
My MAX619 was only rated 60 mA (
Although the absolute maximum is 120 mA)
Therefore, it is easier to connect the micro-controller to the MOSFET to control any LEDs.
The MOSFET has little current, and when the gate input is below 3 v, the MOSFET acts as an interrupt in the circuit.
When the micro-controller issues logic 1 on the pin, the voltage is 5 v, the FET is on and then acts as a short circuit (i. e.
A wire).
The 5 v rail will power any amplification circuit of the LCD, the micro-controller and the input sensor.
If we look at different data tables, we will notice that the power consumption is no more than 15-
Maximum load is 20 mA.
Only 1 mA is needed for LCD operation (
Budget is 2 at least when I test).
After the backlight is turned on, it's really up to you to decide.
Connect it directly to the 5 v rail (i tried)
Fine, but make sure it has an on-board resistor (
Trace on PCB)before you do.
Drew 30 mA this way. terrible! With a 3.
It can still see the 3 k resistor (
Ideal for astronomical photography)
Only 1 mA paintings.
You can still get decent brightness using 1 k or something.
My drawing is below 2 mA and the backlight is on and I'm fine!
Adding a brightness knob using a 10 k potentiometer is trivial if you wish.
Ir led may need 100 mA Max, but I have good results in the range of 60 mA (experiment! ).
You can then halve the current because you are actually running at a duty cycle of 50% (
When the LED is modulated).
Anyway, it only opened for a little while, so we don't need to worry about this.
Other LEDs you should play with, you may find that only 10 mA of the current is enough to give you a good brightness
Of course, look for low-power led (
Excluding IR 1)
You're not designing the torch!
I chose not to add a power indicator to my circuit just because it has a lot of current consumption and not much use.
Use the on/off switch to check if it is on!
In general, you should not run more than 30 mA kilometers at any time, and the theoretical supply is about 2500 kilometers (
Change allowed)
MAh, this should give you more than 80 hours.
Since the processor is idle most of the time, this will at least double/triple, so you shouldn't replace the battery a lot.
It's easy for us to go, isn't it!
You can use the 9 v battery and the low voltage difference regulator, which is cheap and enjoyable at the expense of efficiency, and you can also pay a little more, using a dedicated IC to do this.
Even with the IC, my budget is still below £ 20, so you can lower the budget further if you need.
PinsImage 1 is the pinout picture of atatat8 (
Exactly the same as 168/48/88, the only difference is the number of on-board memory and interrupt options). Pin 1 -
Reset, should be maintained at the VCC voltage (
Or at least logic 1).
The equipment will soften if groundedresetPin 2-6 -
General input/output pin 7-Port D
Power supply voltage (VCC)+5V for us)Pin 8 -
GroundPin 9, 10-
External clock input (XTAL)part of Port B)Pin 11 -
13 Port D, general input/output pin 14-
Port 19 B, general input/output pin 20-
Analog supply voltage (AVCC)same as VCC)Pin 21 -
Analog voltage reference table 22-GroundPin 23-
28 port C, universal input/output available I/o port: D = 8, C = 6, B = 6A there are 20 available ports in total, for simplicity, you should Group the output into ports (
For example, D as the output port)
Or group on the board.
To keep the wires in the corner tidy, you may want the LCD to run from Port C.
Additional three pins are required for programming.
These are miso (18), MOSI (17)and SCK(19).
However, these will be happy to act as I/o pins if needed.
The signal we send to the camera needs to be timed precisely (
Accurate to about 1 microsecond)
So it's important that we choose a good clock source.
All AVRs have an internal oscillator from which the chip can get the clock.
The downside to this is that they can fluctuate around 10% as the temperature/pressure/humidity increases.
All we can do is use an external quartz crystal.
These are at 32768 kHz (watch)to 20MHz.
I chose to use a 4 Mhz crystal because it provides a considerable speed, but it is quite conservative compared to 8 Mhz.
Onboard power management really wants to use sleep routines in my code.
In fact, I wrote the first version, heavily relying on idle processors when timing.
Unfortunately, due to time constraints, I had some problems with running the clock externally and using a timer interrupt.
Essentially, I have to rewrite the code to handle the controller instead of waking up --
I can do that, but time is not good for me.
So the device can only attract 20 mA ish so you can get away with it.
If you are really ready, then to modify the code anyway, you just need to clock internally and then run timer 2 in asynchronous mode using a 4 MHz crystal, to get a more accurate delay.
It's easy to do, but it takes time.
ADCThe Swiss Army knife is in the tool set and ADC represents analog to digital converter.
From the outside, it's relatively simple how it works.
Sample the voltage on the pin (
Input from some sensor or other)
, The voltage is converted to a digital value between 0 and 1024.
When the input voltage is equal to the ADC Reference voltage, a value of 1024 is observed.
If we set the reference to VCC (+5V)
Then each department is about 5/1024 V or 5 mV.
Therefore, adding 5 mV to the pin will increase the ADC value by 1.
We can use the ADC output value as a variable, then fiddle with it in the code, compare it to something else, etc.
ADC is a very useful feature that lets you do a lot of cool things like turning your into an oscilloscope.
The sampling frequency is around 125 kHz and must be set in proportion to the main clock frequency.
You may have heard of registration before, but don't be afraid!
Registers are only sets of addresses (locations)
In memory.
Registers are classified by bit size.
When we start with 0, there are 8 positions in the 7-bit register.
Almost everything has registers and we'll take a look at it in more detail later.
Some examples include the PORTx register (
Where x is B, C, or D)
Whether the control pin is set high or low, and the pull-up resistor is set for the input, whether the pin is output or the input DDRx register, etc.
The literary beast of DatasheetA weighs about 400 pages;
Data sheets are a valuable reference for your processor.
They contain every register, every pin, how the timer works, why the fuse should be set, and more details.
They are free and you will need it sooner or later, so download one! www. atmel.
Com/dyn/resource/Product _ documentation/doc2486.
PdfI has mentioned the inputs and outputs we need, so we should assign PINs for them!
Now, Port D has 8 pins, which can be used as our output port, which is very convenient.
7 pins required for LCD operation
4 Data pins and 3 control pins.
Only one pin is needed for the ir led, which makes up our 8 pins.
PORTB will be our button port and it has 6 inputs but we only need 5 inputs.
This will be the mode and direction buttons.
The PORTC is special and it is an ADC port.
The trigger input requires only one pin and it makes sense to put it on PC0 (
In this case, the common abbreviation port C for the port pin, pin 0).
Then, we have several pins for the status indicator (
When the ADC value is higher than a condition, one is lit, and the other is lit when it is lower than a condition).
For reasons that will become clear later, we will also enter the OK/shot button here.
We 've run out of most of the ports after all this, but we still have some remaining ports if you want to extend this project --
Could it be multiple triggers?
Note: Images used without permission will send a signal to the camera using an infrared transmitter.
The result of this is that it's wireless and you can't possibly damage your camera (
Different from connecting things to camera ports).
If you damage the camera by pointing the IR transmitter to the camera, then of course I hope you don't take the camera outside!
Software we need to simulate both states, for all cameras (
It is true that IR communication is more or less).
Communication is sent in the form of 1 and 0, high, low.
First is the on state, we have to turn the transmitter on and off quickly when we send a logical state.
We modulated the signal.
Different manufacturers have different requirements for this. Nikon is 38.
4 kHz, a little less canon.
Most cameras use 38 k.
In order to get this modulation, we calculate the period (1/f)
To know this, let's say Nikon, we need to have an on/off cycle every 26 microseconds.
The modulation is symmetrical, so 13 US is required for on and 13 US is required for off.
Nikon sequence is (
Pay tribute to BigMike. it)
: The sequence of 2000 uSOn of 27830 uSOn of 390 uSOn of 1580 uSOn of 410 uSOn of 3580 uSOn of 400 uSOn of uSOn is pulsed and then pulse again and take photos.
Note that most of these numbers can be divisible by 13.
For Canon (
32 kHz modulation-
Due to cycle (30uS each)Pause for 7. 3ms16 cycles (30uS each)Much simpler.
Use the exact delay library in the code, because most of the Nikon sequences are multiples of 13, we can use for loops to browse them to get the relevant amount of punctuality (
Rest time is just a normal delay).
There are guidelines that suggest you use Assembly to get the exact time, but as a document
Diy link shows that the time can be far away and still generate a valid trigger signal.
The delay library I use is based on the delay of the clock cycle (
Knowing the clock frequency and the number of clock cycles required to perform a given function)
So it's very precise but limited to your Crystal precision.
If you have a different camera, just modify the shot ();
The function in the final C code.
This should be fairly easy if you know the modulation and pulse sequences.
Olympus: look at the source code of the sequence hardware area where we will use a high current transmitter, we can't simply draw the current through the microprocessor (
See data sheet for absolute maximum rating).
Instead, what we have to do is extract it directly from the battery with an electronic switch MOSFET.
Unlike transistors, the mosfet is very easy to use and requires tedious calculations to obtain collector and emitter current, gain, etc.
The 2N7000 that I suggest you buy is a basic low power fet.
There are many different "fet" that can be used to switch many amplifiers using a micro-controller, which will be exhausting if they try to draw this current.
There are three parts of the Fet, source, gate and drain.
The source lead is connected to the ground and the gate is connected to the micro controller pin (
I just connect them directly, but you can always put a resistor just in case
Check threshold voltage).
The component to be turned on is connected to the power rail and drain lead.
When the threshold voltage is reached on the gate-i. e.
When micro overhead-
Fet starts conduction and completes the circuit between the power rail and the ground like a wire.
For 2N7000, the threshold is up to 3 v and the minimum is 0. 8V.
We also noticed the drainage system.
SOURCE resistance (
Fet bridges the elements to the ground like a resistor)is very small -
In the order of maximum 5R.
Although this is very small, it may mean a significant decrease in current on the transmitter
You can compensate by lowering the value of the resistor in series with the transmitter.
Use a very useful LED calculator ()
Forward voltage when entering 3 v (
View data sheets for emmiter)of 1.
The current of 7 v and 80 mA is 18R.
You can get away with 12R, but I will stick to 18R for the sake of safety.
Figure 1 shows how our 3 v rail connects the circuit in this case.
The LED is currently on when the gate sees 5 v.
If you would like to know how globets actually works and more detailed technical information :-
If I make any mistakes, please read the breadboard tutorial first!
CPU/LCD 1x or 168 (
At least 8 k memory required)£1.
501x HD44780 compatible LCD screen £ 4-6 (
If you want cool colors)
10 KPot from eBay1x (
Or try a different resistor)
Contrast Control 10-
30p1x 4 MHz crystal-
Ceramic/ta 22pF capacitors-20p2x20p1x 4K7-10K resistor (
Will really do it. 1x 10-
Plug/socket (
If you want to have a programming port on the finished Board-recommended)-
28 pinDIL socket (0. 3")
Red, Green (2 times)
3mm, but you can choose any color you want. . . )
Total :~ 8Power1xMAX619 DIP8-£2.
71 Farnell1x monthly pinDIL socket2x 470nF TA capacitor
20p2x 22 uFLowESR electrolytic capacitor-20pTotal:~£3.
50ir1x high-power IRLED (2V, 100mA)-15p (rapid 58-0112)
1x 18R resistor 1x 2N7000 MOSFET (or similar)-10p0.
5 M Horn Cable (
Or other 2 core wire)-50pTotal ~£0.
75Input6x switch spstmomentum-£1.
20x on/off switch-40pTotal ~£1.
Resistors or photodiodes related to light-
30p1x potentiometer, rated resistance is the same as the maximum resistance of LDR/diode-10-
Month cryptotal ~ £ 1SoundTrigger1xElectret microphone50p (
It's cheap to buy in bulk on eBay)
1x 220R resistor 1x 100n capacitor (
Ceramic/ta)-
1p1x TL072 or similarAmp -
10 uf capacitor-20p1x
10p2x 22 k resistor 1x 1K2 resistor 1x1 k resistor 1x 1 m potentiometer for different gain (0 -1000)50pTotal: ~£2.
00Enclosure1x ABS case for installation of components-
You got your choice.
Double AA-70p1 x battery box
20 p in total: 1 show
From eBay1x 10 pinISPheader1x 28-pin DILsocket (0. 3")
Total month £ tool/sundriessolding irronsoldder wiresoldder suction cup/BraidSmall FilesDremel/rotary ToolNeedle nose pliersssorswiswire StrippersWires (
Single and Multiple shares)
Stripboard cost minus tools/programmers: 18 ishparts were purchased from rapidonline and Farnell UK.
The price is roughly accurate.
I don't calculate the price of the resistors because they are very cheap these days and each one is about £ 0. 0025.
In any case it is worth coughing for a choice and they spent about 5
A mixture of about 600 resistors.
I apologize if I missed a component but later used it in the schematic!
I suggest going to this project (
Unless you have experience.
First, we will set everything on the prototype board (breadboard).
Starting with the power supply, check if it works with the multimeter or plug in the LED resistor to make sure it works properly.
Then put in a programmed, connect the power rail and try the "hello world" flashing light app.
You can test a basic remote when you know your programmer is working
When opened, a shot is triggered every other time (
This also demonstrates the function of the interval timer).
Next we will add the button.
Then we can start looking at the ADC, but we need the LCD.
So before we play with the trigger, we need to weld the screen and connect it to the microprocessor and run some simple LCD routines to make sure they all work properly (
There is a good app that is provided by the gentleman who wrote the libarary I am using *).
Intervalometer will also be added to the menu system.
Once it's set up on the motherboard and the program starts working, we can start copying it to the stripboard.
The IC will be in the socket for easy disassembly, worth adding 10-
Pin head so you can program the chip when it's on the board.
But this is beyond ourselves!
* This will vary depending on the route you decide to take.
If you buy MAX619 (
Data Sheet attached), read on!
Most integrated regulators operate in roughly the same way.
We have an input with a capacitor and an output with a capacitor to eliminate the voltage ripple.
The bigger these capacitors, the smaller the ripple you get, but if you're using an electrolytic capacitor like me, then you want to keep it as small as you can.
Low ESR represents a low equivalent series resistance, and you can read more here: you need to get it from components and tools at this step: MAX6192x Tantalum 0.
47 uF capacitor 22 uF (Low ESR)
I like to give the code line color when I am wiring on the breadboard, it really helps to track the circuit path with complex circuits, you can easily see which ones are ground wires etc.
This chip may be in an anti-static package in a tube.
Touch the exposed metal on the computer, grind it yourself and pop up the chip-
You're unlikely to really damage a chip by touching it, but as we all know, it happens. The semi-
The circular notch indicates the top of the chip and the pin in the upper left corner is pin 1.
If we look at the data table for MAX619, we can find the pins and the sampling circuit.
Page 6 has the circuit we want to implement.
Note that these two ta capacitors Connect pins 1 and 8, 4 and 5.
These are convenient at both ends of the chip.
We noticed that Vin was connected parallel to pin 2 with the electrolytic cover.
Again, Vout comes from pin 3 and there is a parallel cover ground.
Pin 6 should be grounded and we don't need to connect pin 7.
Put the chip in the middle of the board and remember that the rows are connected, so we don't want to connect any pins together.
Put in a ceramic capacitor and you may find it easier to run a short piece of wire (
My hat legs are short)in series.
Decide you want to be a track for 5 V and 3 V
I chose to be 5 v outside, so this is where I connect Vout.
The battery should be connected to pin 2 from one of the tracks.
Remember to connect your electrolytic cover in the right way, and the strip on the side usually indicates negative-
It will be printed there.
Connect the red flying lead to the positive 3 v rail and the black lead to the public ground.
These pictures should let you know what it should look like.
Be sure to test the 3 V and 5 V rails with a multimeter.
If it doesn't work as expected, check to make sure you don't accidentally cross any wires or incorrectly connect two leads.
If you smell burning plastic, please unplug the lead immediately, you have a few seconds before your chip leaves, goodbye = PIn this step, we will make the prototype of the circuit.
You need your micro-controller, 4 MHz crystal, two 22pf ceramic capacitors, a 10 k resistor and some wires for VCC and ground.
We will also have several LEDs installed so that we can run a test application to make sure everything is OK.
Place the micro-controller on the breadboard to cross the middle ditch.
In the same way, we don't connect the opposite pins to each other. First, pin 1.
This is reset and should be kept in logic 1 when the chip is working.
Connect it to a 5 v voltage rail via a 10 k resistor (
And some wires if you need them).
After work, we can get the pins 7 and 8.
VCC and ground, respectively.
Connect pin 7 with (red)
5 V rail and 8 pin grounding wire.
Also connect pin 20 to VCC on the other side (AVCC)
And sales 22.
Place the crystal so it can connect pins 9 and 10.
Then, connect the capacitor on each pin to the ground (
You can put the capacitor into the ground pin).
For LEDs, we will use pins 24 and 25.
Connect the resistor and LED in series with each pin (To the ground).
Check whether the LED polarity is correct (
You are unlikely to burn it out with low voltage if you wire it back, but it won't turn on).
The negative leg is indented on the same side as the plane in the plastic case.
Check the picture below, compare it with your circuit, and proceed!
If you already have a programmer and are happy with flashing files to a chip, you can skip this step.
If you don't have a programmer yet, it's time to buy one.
Cost varies from DIY model to GBP60in-one boards.
The model I chose is USBasp, and although you can buy it from someone else or build it yourself, it took me to buy GBP12 from eBay.
It's the cheapest USB model I can find, about the size of a big memory stick, perfect for what we're doing.
My only problem is trying to install the driver on Windows 7, but this is another story.
Note that the libUSB driver is compatible with Mac and Linux.
The upload method of most programs is through the ISP (
In System Programmingcable.
There are 6 pins and 10 pin varieties, which are basically the same.
The ground wire of the 10-pin cable is more than the 6-pin cable (
Only one need to be connected).
If you look at the pin of the cable (image 1)
Most of the names of these pins should be familiar.
Yes, they came from the chip.
The programming process is simple, it is to plug the cable into the programmer and then connect it to the pin of the pin.
My approach is to use the cradle of programming.
It is very simple to make, only two components are welded on a strip board with wire connection pins.
These components are 28-
Pin DIL socket, or no matter how many pins your chip has, and a 10 pin male head that fits the ISP cable.
To build it, all you have to do is weld both to the board (
Make sure you cut off the relevant track so as not to connect the opposite pin
I used a dremel with engraving tips for this)
And find out the bits that should be connected together from the pin map.
One very important thing to note is that if you change the fuse position to enable the external crystal, the chip will look for it (
And the capacitor it needs)
When you program it won't power up correctly if it's not connected (
The programmer will report a mistake to you).
So for me, I welded a few wires (
They are white in the picture)
The crystal attached to the breadboard.
You also need to connect the ground wire to the ground of the Crystal/capacitor block.
If in doubt, the real Elliot has some good instructions detailing how to build a programming cradle or an entire serial programmer.
The code is simple and you can do it in C or assembly language.
I chose C because I was more comfortable with this and it was easier for others to see what I was doing.
Can be made using any text editor. c files (
And any title, etc)
My preferred way to compile/link is to use the command line (
This is easy).
First of all, download a win-
Or MacAVR is a useful set of tools such as compilers, code headers/libraries, etc.
Basically all you need to do is start programming and upload your code.
The coding of AVRs is very simple.
You can include standard libraries for sorting, string operations, math, and more simply by writing code in normal C.
Depending on what the code contains, you need to include the relevant libraries such as io, sleep, interrupt packets (
Library is always needed).
After writing the code, it must be compiled and linked.
The easiest way is to use makefile.
Makefile did all the effort for you, all you did was specify the name of your C file and any assembly file (Must call. S -case sensitive)
And the processor you're using.
This file is in the same directory as your source code.
Here is a good template: will not go through the process of writing the make file, the template above is annotated and should be obvious :)
Actually compile the code.
Your micro-understandable hex binary, we just use the command prompt.
Use the "cd" command to navigate to the directory you need and replace it with the Directory of the file.
Then just type "make hex" and press enter.
The result should be a few lines of text you can ignore and.
The Hex file should appear in the directory containing the source code.
If something goes wrong, the compiler will spit out an error, usually the file where the line number and the error are located.
You can then go to the line reference, fix the problem and try again.
The code I provide here should be compile-able or at least compile on my machine.
I won't say a bug-
Because no code is ever free!
I will try the code function if I can.
This is a very good review in my opinion, so it should be fairly self-explanatory for experienced programmers.
The Code we will be using is rather complex, dealing with many things newbies want to know using ADC and timer interrupts, processing inputs and outputs, interfaces with monitors, sleep modes, and more.
This is a great starter book for me anyway = DOk, let's go into your first program and try to upload it!
Just like all programming, let's make a basic "hello world" app just to make sure everything is OK and make sure it's set up.
We do not interfere with the external clock, we only turn on and off the LED flashing regularly.
The code is attached below, called "led_blinker ".
C ", there is also the exact delay library and makefile we need for this project in the folder.
You should edit your makefile to correspond to the chip you are using
If you don't do this, it won't work when you upload it!
Let's take a look at the code: include "adelay ".
Include
Custom message
Chat Online 編輯模式下無法使用
Chat Online inputting...
{ganrao}