Notifications
Clear all

ATMEGA328 PCB Programming

27 Posts
5 Users
1 Likes
2,348 Views
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 
Posted by: @robotbuilder

@kishwa

@robotbuilder Wired in the breadboard it definitely worked, which is why I fail to see where I went wrong. Agreed it ~should~ be the PCB that's the problem, I'm just not sure where exactly that is.

[snipt]

Hopefully @will will be able to figure it out.

No, I think I'm out of it too.

If he had started with an actual Arduino and a DRV8833 driver module and added to the basic sketch as he integrated new parts like the LEDs, then the buttons, then the DRV8833, then each new part could be integrated and analyzed as the circuit expanded. Bugs appear and be corrected as each new part was added.

By just using chips and throwing in some support components, then it creates such a maze of rabbit holes because you can't trust any of the parts for operational integrity nor proper use of support components.

Ditto for the software, it contains fragments of dead code inherited from the original "copy and paste" source, so you can't even count on it, it just makes it harder to identify and trace the relevant command path.

The LEDs appear to me to be inserted backwards (i.e. anode to GND) and the DRV VINT being tied HIGH instead of LOW to GND makes me lose faith in the assertion that it ever worked properly on the breadboard 🙁

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6662
 

@kishwa The astronomy community developed inexpensive trackers a long time ago. Now of course they use Arduino's and RasPi's etc all battery powered. There are a couple of different designs, the curved screw is an older design, the latest is the double hinge that compensates for some small errors introduced in the classic design. Very roughly all you need to do is move the mount every few seconds, it can even be as long as 30 seconds for some subjects. You might be wise to check out the astro community for ideas.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6662
 

@kishwa Here is a link to the double arm barn door tracker. There is also a YT video which can likely be found by searching the author name on YT.

http://davetrott.com/inventions/double-arm-barn-door-drive/

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@kishwa)
Member
Joined: 2 years ago
Posts: 12
Topic starter  

@will It does work on the breadboard, relatively well I'd say. Couldn't take a long video due to size constraints, but here it is. Unfortunately just can't figure out why there is a disconnect between breadboard and turning it into a PCB. Obviously code works though.

Preview attachment IMG_3894.jpg

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@kishwa 

Do both buttons work properly on the breadboard ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@kishwa)
Member
Joined: 2 years ago
Posts: 12
Topic starter  

@ronalex4203 For sure, these are great designs. I've done a lot of research on the topic and the barn door trackers are solid but they lack in a few areas and are only as precise as the person who built them. They're difficult to polar align, only run for a limited amount of time (max maybe an hour or two), are often bulky, and have a limited weight limit which contributes to a smaller exposure time and smaller equipment. 

 

I've replaced the traditional worm gear with an arm similar to the omegon mini track or astrotrac but with off the shelf components. It keeps the cost super low but allows for high weight capacity for the size and with the right math/motor control can be quite accurate. Hoping to build a few, throw it on reddit and see what others think when it's finished. So far the mechanics work rather well!


   
ReplyQuote
(@kishwa)
Member
Joined: 2 years ago
Posts: 12
Topic starter  

@will yes sir, first video doesn’t have it attached but I just included it and it worked like a charm 

This post was modified 2 years ago by Kishwa

   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@kishwa 

And do all three LEDs light when and as expected ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

@kishwa

It seems you need to debug the PCB, connection by connection.  How was it designed? Automatic from the schematics? When I have decided to make a soldered version of a breadboard layout I do it carefully connection by connection on a veroboard, no fancy printed circuit board. Not being there I can't see your breadboard and PCB layout to compare connections.

 


   
ReplyQuote
(@kishwa)
Member
Joined: 2 years ago
Posts: 12
Topic starter  

@will yup LED's work too... I'm going back into the PCB design to make the changes you suggested and make sure that the schematic lines up with the datasheets, then I'm going to double check everything with the breadboard and go from there


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@kishwa 

I would VERY strongly suggest that you use a real Arduino and a real DRV8833 driver module instead of trying to use the chips alone. Just design your PCB and leave holes for female headers to hold them so you can retrieve or replace them later as needed.

As you can see, it's hard enough to write the software without introducing all of the rabbit holes created by patching together cut-n-paste sections of other people's work. Using known working components for those two modules will let you start and work with a solid base for the PCB and eliminate all of the niggles associated with debugging the support components needed for the bare chips. Besides that, you'll have the advantage of being able upload programs effortlessly and also to use Serial.print to see what's going on in your sketch.

If your LEDs work, then you haven't wired up your breadboard according to your schematic, or you've changed your breadboard without correcting your schematic to match.

Anything seems possible when you don't know what you're talking about.


   
huckOhio reacted
ReplyQuote
jker
 jker
(@jker)
Member
Joined: 3 years ago
Posts: 82
 

While the atmega328 is a fairly easy chip to design a PCB for, you do need to make plans for programming it via serial ahead of time.

However... for anything that can be described as "simpler than a basic 3-axis CNC machine with limit sensors", you may want to seriously look into a CNC shield. They are dirt cheap, provide mounting points for up to 4 DRV8833 (or similar) drivers, and easily mesh with a standard arduino uno.

"A resistor makes a lightbulb and a capacitor makes an explosion when connected wrong"
"There are two types of electrical engineers, those intentionally making antennas and those accidentally doing so."


   
ReplyQuote
Page 2 / 2