Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

programming the atmega #1

Open
bassybeats opened this issue Apr 11, 2024 · 6 comments
Open

programming the atmega #1

bassybeats opened this issue Apr 11, 2024 · 6 comments

Comments

@bassybeats
Copy link

Hi, do you have clearer instructions on how program the chip? I don't really understand how you set the RC Oscillator. What did you use to program the chip via the pogo pins?

is there a way to program the chip out of circuit with an arduino or the tl866?

@aignatiev
Copy link
Owner

I have a custom made, 6-pin ISP connector made with pogo pins (P50-B1). The ones on the edge are the same pins turned the other way around and used as guide pins (they are nicely rounded on the other side).
IMG_20240309_153616

For programming I used usbasp, but any ISP programmer should be fine. Arduino seems to be capable of doing that.

For calibrating I used the CKOUT fuse to output the main clock frequency to the CLKO pin (PB0) and read that with a frequency counter. It's not as easy to do if you don't have a frequency counter of any kind. The calibration is non linear so you have to set it using trial and error. I had some idea on how to do it without the frequency counter, but I never implemented that.

@adsl95
Copy link

adsl95 commented Oct 7, 2024

Hello,How to set up the fuse?
Can I use an external 12m crystal oscillator without modifying the program?

I don't know English and may have some problems translating, I hope you can understand what I mean.
Thank you and wait for your reply.

@aignatiev
Copy link
Owner

Hi. Yes, you can add a 12M crystal and configure the fuses appropriately (Low Power Crystal Oscillator, CKSEL = 1111). I think no changes to the code are needed.

@adsl95
Copy link

adsl95 commented Oct 31, 2024

Hello, can all the specific fuse bits be used 0xFF? That is, the high-level and low-expansion bits are all 0xFF, or should there be more specific settings? Because the link in your description uses attiny24's post, the fuse bits are all used 0XFF.
Wait for your reply, thank you.
QQ截图20241101003259

@adsl95
Copy link

adsl95 commented Oct 31, 2024

Hello, I have other questions I would like to consult.
Because you only provide the source code and don't have a .hex file, if you compile it yourself, do you use keil4 or avr studio?
What is the approximate .hex file size after compilation, for example, atmega8, a single-chip microcontroller with 8k flash space, can you use this program? Or do you need a 16k space like atmega168?
Wait for your reply, thank you.

@aignatiev
Copy link
Owner

Hi. Fuses are model specific, please read the respective datasheet. This project should not require any fuse changes from the defaults unless you want to use an external crystal. I have used Atmel Studio for compiling this project and the resulting binary should be quite small. I don't have the setup to compile this right now, but it should be less than 2k since it originally fit the attiny24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants