#avr | Logs for 2016-10-09

Back
[00:20:14] <anonnumberanon> No Lambda_Aurigae The C Programming Language does not teach very powerful CS concepts that cannot be found in a good tutorial anywhere else, and is not very concise.
[00:33:24] <anonnumberanon> Also I found it does not make you write a lot of code and think about algorithms yourself.
[00:33:31] <anonnumberanon> :3
[00:46:23] <tiblock> Casper, i am trying to test it for hour and i can't get it to do anything. I am using AtmelStudio and it has example there "MEGA_UART_INTERRUPT_EXAMPLE" http://pastebin.com/raw/x8BdH7eT and as i understand on startup it should send "Hello, world!" to serial. I trying to solder USB-UART thing in different ways to RX/TX and see nothing. I try soldering LED and see nothing.
[00:46:32] <tiblock> Power is 1mA-3mA so it is doing something, its not dead
[00:47:05] <Casper> tiblock: be sure that your pc side is set to 8n1 and no flow control
[00:47:06] <Casper> also
[00:47:21] <Casper> if you do not have a crystal on your avr then it may cause issues
[00:47:41] <tiblock> I did not soldered crystal if you mean that
[00:47:51] <Casper> also, try a loopback test... on your usb-serial, connect rx to tx, and see if you get an echo
[00:47:58] <tiblock> I do see it
[00:48:07] <Casper> the internal RC may be off by up to 10%
[00:48:33] <tiblock> I don't see LED blinking when i solder it to RS/TX on ATmega
[00:48:56] <tiblock> RX/TX should be on + of the led, right?
[00:50:25] <tiblock> Let me try upload LED blinking example on PD5, if it will not work, then i killed something
[00:51:48] <tiblock> It work. Chip not dead.
[00:53:20] <tiblock> Casper, by the way, i try both RXD and TXD on chip, can you tell me from what port data is comming out so i will test only it? RX or TX?
[00:56:08] <Casper> I'ld have to pull up the DS, don'T feels like so
[01:52:17] <anonnumberanon> tiblock, you don't see LED light up so that means' you are not sending anything
[01:52:30] <anonnumberanon> show code for your UART send program
[02:10:37] <tiblock> anonnumberanon, "MEGA_UART_INTERRUPT_EXAMPLE" http://pastebin.com/raw/x8BdH7eT
[02:20:53] <anonnumberanon> tiblock, so you have a uno right now, that is what you are working with?
[02:21:17] <anonnumberanon> I mean... you have a mega2560?
[02:21:52] <tiblock> anonnumberanon, i just bought atmega328p and made this http://imgur.com/a/GzJnq
[02:23:15] <tiblock> anonnumberanon, and i have AtmelStudio where i got blink example and that UART example
[02:42:01] <anonnumberanon> tiblock, that's nice but do yo have a crystal/oscillator outside of the microcontroller?
[02:42:13] <tiblock> anonnumberanon, no
[02:44:06] <anonnumberanon> Okay so you may need to be careful when you upload the code because some things that I don't remember abo9ut ask you to upload the code saying frequency = 16 mhz, or whatever, it changes according to what frequency you are running. I think it is in the code but if you are using the Arduino IDE then things will be set to 16 Mhz. Right now your setup runs at 8 Mhz so that is different and you may need to adjust fcpu in the code, or
[02:44:06] <anonnumberanon> whatever. I never had to do it I don't know.
[02:44:12] <anonnumberanon> how
[02:44:16] <anonnumberanon> don't know how
[02:44:41] <anonnumberanon> also can you please make a small code instead of that paste you did? it's huge and has a lot of comments I don't want to read.
[02:48:15] <tiblock> anonnumberanoni, i use AtmelStudio and i don't know C, i just got example from AtmelStudio and i have no idea how it works. And if i want to use external crystal, will any crystal work or only 16 Mhz? I have some unknown crystal-shaped thing marked as "R143CA66" that i can't google and i have barrel-shaped thing that says "32.7680". Will it be too much?
[02:49:42] <tiblock> I am looking at video here about how to make arduino uno so arduino IDE will work and crystal is needed there so i'm thinking here
[02:53:10] <Casper> any crystal work, provided that you stay within the allowed frequency
[02:53:32] <Casper> be advised that you also need 2 capacitors (13-27pf) on the crystal
[02:53:43] <Casper> and change the fuse settings
[02:54:09] <Casper> be aware that the wrong fuses may cause the chip to stop responding
[02:54:17] <tiblock> I have capacitors kit. I bought lots of components for learning.
[02:54:28] <Casper> (ex: if you screw up and set it to external clock instead of external crystal)
[03:03:08] <carabia> 32.768 is in kHz i'm pretty sure
[03:03:15] <carabia> usually used for rtcs
[03:03:36] <carabia> and I don't think you can set a PLL for the external crystal with atmegas(??)
[03:03:38] <Casper> if you screw up the fuse, you can recover the chip with another avr (just make an insane led flasher to make a clock source)
[03:03:50] <Casper> time to sleep, nite
[03:04:14] <tiblock> I'm thinking and thinking and thinking here... What is crystal used for? Can't chip correctly work without it?
[03:04:26] <tiblock> Casper, bye
[03:05:18] <carabia> tiblock: well it needs to sync itself
[03:05:37] <carabia> otherwise the logic gates could be in an undeterminate states
[03:05:57] <anonnumberanon> tiblock, the crystal outside the chip with the 2 capacitors is to make the chip run faster, you don't need it but if you don't use it then you need to change fcpu in the code
[03:06:33] <carabia> tiblock: you can use the internal oscillator
[03:07:24] <carabia> and depending on the model you can even use the output of the internal pll hooked to it as the system clock
[03:09:21] <carabia> also F_CPU is used for delay.h
[03:10:41] <carabia> but as said the 32.768 is an rtc crystal and it's kinda not what you want. It's 32 khz, basically.
[03:10:51] <carabia> the other one, no idea.
[03:11:17] <carabia> but depends on the chip, you should be able to get it running 16 mhz and over, using the pll
[03:11:33] <carabia> on the internal osc
[03:14:53] <carabia> long story short: rtfm + clock management
[03:19:59] <tiblock> I need a plan here. I want to do some board to show to friends to show what cool stuff i made. I am thinking of board that have button and led on it. I have RGB leds, so it will be red until you press button in special pattern. Like password. Then LED changes to green and it starting to work. And work i think will be photoresistor + another RGB led. If there is low light then led is red.
[03:20:15] <tiblock> If light is medium, then yellow. If max then green. Is that sounds cool?
[03:20:30] <tiblock> I want to make 2 layer PCB for that
[03:21:14] <tiblock> I have micro USB connectors for power it from portable power bank and LM317 to get 3v3 voltage
[03:24:59] <carabia> you don't really need a voltage reg in there
[03:25:17] <tiblock> It will work from 5 volts?
[03:25:20] <carabia> atmegas and tinys run happily off of 5v
[03:25:53] <carabia> just maybe add a big input cap and small caps near vcc/gnd pairs on the mcu
[03:26:16] <tiblock> Thats good.
[03:26:48] <tiblock> So now i need to find and flash arduino uno boot loader and set fuses like in arduino uno, right?
[03:29:06] <carabia> why?
[03:29:38] <carabia> i'm thinking the fuses on the chip on arduino boards are set to use an external crystal
[03:29:46] <tiblock> Uhm, i want to use arduino IDE because its easier and easier to google solutions
[03:29:46] <carabia> now if you don't have one, you don't do that.
[03:31:14] <tiblock> I found out that i do have crystal. I bought so much components that i forgot what i have and what i don't. Some times i bough same components two times because forgot that i bought them already. I have 16 Mhz crystal
[03:32:14] <tiblock> Who kmows what also i have. There is big box of electrical components
[03:32:23] <anonnumberanon> yes that's good tiblock that's what I do, and I never miss part at the end of the day even though I get stressed thinking about I can't finish my project because parts
[03:32:44] <anonnumberanon> so add the crystal and the two capacitors to your board and it should be ready to run nice
[03:32:57] <carabia> tiblock: you want some load caps on the xtal like Casper said
[03:33:02] <tiblock> But first bootloader?
[03:33:14] <anonnumberanon> or else you understand the code and change the frequency but evne i and i have experience and i don't know how to do it and don't care
[03:33:40] <carabia> anonnumberanon: you are only amplifying my understanding of your stupidity
[03:33:58] <tiblock> I do have 3 kits of capacitors and wait another one. I have ceramic SMD and big caps (electrolitic they named?) little capacity and big. From 0.1uF to 2200uF i think
[03:34:42] <carabia> the load caps for crystal are small, depending on the load capacitance. you want something like 10-30 pf
[03:35:26] <carabia> small ceramics usually. electrolytics aren't even made that small.
[03:35:30] <tiblock> I found this video, there is 22pF https://youtu.be/_m9aciePKEk i think i have them
[03:35:37] <tiblock> at 5:00
[03:36:22] <carabia> 22pf should be fine. it depends on the crystal's load capacitance and well, traces, but you don't have to get all that accurate.
[03:37:26] <Thrashbarg> jumping in here without knowing much about what's going on but if you're trying to run a serial port, you'd need a crystal that gives the correct serial baud rate right? Like a 18.432MHz crystal
[03:38:14] <tiblock> I need serial for arduino IDE, arduino uses 16 Mhz so it will work i think.
[03:38:36] <Thrashbarg> right. What sort of serial interface are you using?
[03:38:49] <Thrashbarg> I mean what's connected to your PC?
[03:38:59] <tiblock> Ft232rl USB-UART
[03:39:44] <Thrashbarg> okay I'm not 100% sure if the Arduino IDE will set that to a baud rate which has a nice multiple of 16MHz for the baud rate. I know the one built into the Arduino boards does
[03:39:49] <tiblock> But wait, since i go with 5 volts i have another USB-UART for 5 volts
[03:40:45] <tiblock> Oh, nevermind, there is no DTR pin that needs to be for reset, so i go with Ft232rl
[03:41:34] <tiblock> Thrashbarg, i have arduino UNO and there is 16.000 crystal
[03:41:58] <Thrashbarg> you also know that you don't need to use the Arduino IDE, it's relatively straight forward to install the AVR GCC package and run it through a few shell commands...
[03:42:15] <carabia> but he apparently wants to \:D/
[03:42:20] <Thrashbarg> yay
[03:42:37] <tiblock> I have AtmelStudio and i open PWM example and its sooooo biiig, and in arduino IDE its small and easy
[03:42:48] <carabia> except the shit it generates is horrible
[03:42:53] <Thrashbarg> lol
[03:43:35] <carabia> tiblock: you would be better off actually understanding the registers, but YMMV
[03:43:41] <tiblock> Im only second day in this PCB thing, i started yesterday, i know nothing, is fine for me
[03:43:44] <carabia> because that's all it boils down to
[03:44:08] <carabia> the internet is full of example code for avrs in plain C
[03:44:15] <Thrashbarg> tiblock: there are better examples of ATmega PWM online lol
[03:44:21] <Thrashbarg> yea
[03:44:31] <carabia> and the registers don't differ that much between the devices so the code is easily portable.
[03:44:37] <sabor> the datasheet is also full of C examples :)
[03:44:45] <tiblock> carabia, i do understand turning leds ON/OFF with registers. I understand how 1 byte if 8 bit and there is 3 registers and each register is 8 bit and each bit is mode/state, but PWM and timers is very very hard
[03:44:58] <carabia> tiblock: no, they really are not.
[03:45:08] <Thrashbarg> perhaps, but it's easy when you know how ;)
[03:45:28] <carabia> it's not even to know how, it's to know at all.
[03:45:43] <carabia> everything is hard if you have no idea of the context
[03:45:50] <Thrashbarg> that'd be my point hehe
[03:45:51] <carabia> it's not just hard, but impossible and stupid
[03:45:59] <tiblock> carabia, but look in this "MEGA_UART_INTERRUPT_EXAMPLE" http://pastebin.com/raw/x8BdH7eT for UART, is huge. And im sure in arduino is few lines
[03:46:30] <Thrashbarg> oh jeez they're doing it that way...
[03:46:57] <Thrashbarg> that's more an example for people who have been programming for longer than computers have existed :P
[03:47:07] <tiblock> So i need arduino IDE
[03:47:11] <carabia> tiblock: no you don't
[03:47:11] <Thrashbarg> nope
[03:47:27] <carabia> first to even start understanding that you need to know wtf interrupts are
[03:47:30] <tiblock> I even can't make that example work
[03:47:30] <carabia> Do you?
[03:47:56] <carabia> also, about timers, i'm sure you have no idea of the different timer modes and how they operate nor have you even opened the datasheet on the page "timers"
[03:48:29] <tiblock> I do. I have raspberry pi, i played with GPIO there and i have 10 pieces of ESP8266 (no idea why i need that much) and i played there too. But on LUA language, its so easy
[03:48:36] <carabia> also i am sure arduino's basic uart is not implemented with an interrupt
[03:49:05] <carabia> Are you kidding me? If there's a language _simpler_ than C????
[03:49:30] <tiblock> And i don't know timer modes, but i did saw datasheet and saw some videos about timers in atmega, there is 3 modes if i correctly remember
[03:49:51] <carabia> in other words, you don't, and you haven't
[03:50:07] <tiblock> carabia, for me yes. I made there webserver from scratch with controlling color of RGB LED via PWM. It was fun and easy
[03:50:10] <Thrashbarg> tiblock: http://www.ermicro.com/blog/?p=1971 <-- scroll down about 1/4, there's some code there which looks sane
[03:50:15] <carabia> tiblock: it doesn't take nearly as much as that to set up a basic blocking uart with an avr
[03:50:30] <carabia> 10 lines?
[03:50:42] <tiblock> I was about yo make websocket server, i have read RFC for it but i neved finished it
[03:50:56] <carabia> 15 tops?
[03:52:11] <tiblock> Also timers in LUA in ESP8266 is super easy
[03:53:49] <carabia> look, if you insist on being ignorant, there's no point in calling out for help in the first place
[03:54:26] <Thrashbarg> calm down there
[03:54:57] <carabia> perfectly calm, i'm just pointing out the fallacy
[03:55:44] <tiblock> I am reading that page, i need some time
[03:55:57] <Thrashbarg> k
[03:58:00] <anonnumberanon> carabia, yo, FUCK YOU
[03:58:59] <Thrashbarg> ...yes
[03:59:53] <carabia> anonnumberanon: >:)
[04:00:55] <carabia> making friends already, i see
[04:04:15] <tiblock> carabia, im need to say im sorry, im lost here, i can't decide do i need USBAsp connector on my PCB, do i need UART for debug, do i need 3v3 regulator because my USB-UART for 3v3, there is jumper for 5v but i made "case" for it and jumper under case and i have another 5v USB-UART but no DTR pin there and i can't decide so i need it for arduino ide and im lost here so im slow/lost/ignorant here
[04:04:24] <tiblock> and crystal under question too
[04:05:01] <Thrashbarg> tiblock: IMO the easiest thing to do is use a USBasp adapter, avrdude and avr-gcc
[04:05:15] <Thrashbarg> write to bare metal, don't bother with Arduino IDE's
[04:05:25] <Thrashbarg> you'll learn more for a start
[04:06:52] <Thrashbarg> this is #avr after all, not #arduino lol
[04:15:59] <tiblock> I will take a walk to store and then learn PWM. I learned how to turn on/off leds through registers, then i failed on UART so i was thinking i need arduino IDE. But now i will look at PWM and will see what will be there. Will be back in some time with PWM questions.
[04:47:49] <anonnumberanon> Come on. Bring back some questions from the stoar.
[06:35:27] <tiblock> I have question. Define "F_CPU" needs to tell code on what frequency chip is running since code can't know it from chip?
[06:37:36] <tiblock> And if i have fuses like that and no external crystal, is it 8 Mhz? http://i.imgur.com/1CnQvqV.png
[06:39:40] <tiblock> Or wait, 0 is active, so its 1 Mhz?
[06:41:34] <tiblock> And another question on top of this. Lower frequency = lower power usage? Is that what frequency changing needed?
[06:59:45] <Lambda_Aurigae> tiblock, yes
[07:00:07] <Lambda_Aurigae> F_CPU is used in calculations for usart speed, and delays and such.
[07:00:25] <Lambda_Aurigae> by default AVR chips come programmed to run at 1MHz on the internal oscillator.
[07:00:40] <tiblock> Lambda_Aurigae, is my chip running on 1 Mhz?
[07:00:50] <Lambda_Aurigae> and the lower the frequency the lower the power usage generally unless you are using sleep modes vs non sleep modes.
[07:01:07] <Lambda_Aurigae> if it is fresh from atmel and you haven't changed any fuses, then, yes.
[07:04:02] <tiblock> Lambda_Aurigae, so correct definition is "#define F_CPU 1000000", correct?
[07:04:11] <Lambda_Aurigae> yes
[07:04:16] <tiblock> Thank you!
[07:04:33] <Lambda_Aurigae> note that you won't be able to do rs232/usart comms reliably on the internal RC oscillator.
[07:04:39] <Lambda_Aurigae> it is not super stable.
[07:04:50] <tiblock> Currently i'm trying PWM
[08:01:58] <tiblock> I have question. I am trying to run "avrpwm01.c" code from this page for few hours http://www.ermicro.com/blog/?p=1971 and i have no PWM on any pin. And there is few problems i can suspect. I use transistor 2N2222 and maybe 675 Hz PWM is too fast for him. Other problem is that "Target: AVRJazz Ultimate 28PIN Board" and its not what i use.
[08:02:26] <tiblock> And "Programmer : AVRJazz Mega168 STK500 v2.0 Bootloader" is not what i use. I have ATmega328P with USBAsp. I'm not sure where is real problem.
[08:02:31] <Lambda_Aurigae> 675Hz is nothing near the max speed of the 2n2222
[08:03:50] <Lambda_Aurigae> you have tested loading a blinky LED on the setup?
[08:05:24] <Lambda_Aurigae> to make sure you can actually compile and upload a working program.
[08:05:44] <tiblock> I do have working blinking program
[08:06:45] <Lambda_Aurigae> I'm guessing you don't understand the software you are trying to use?
[08:06:56] <Lambda_Aurigae> or the chip either.
[08:07:34] <tiblock> Yes i'm new to it so i'm trying to run example to understand then what it does. Only reading that page is not very useful, i want to test and see result
[08:09:58] <Lambda_Aurigae> break the software down into bits and understand what each part does.
[08:10:14] <Lambda_Aurigae> you might find some simpler PWM code tutorials first.
[08:11:52] <Lambda_Aurigae> http://www.electroschematics.com/9941/avr-pwm/
[08:12:03] <Lambda_Aurigae> learn to crawl then to walk before trying to run.
[08:13:11] <tiblock> But that code was simple... I thought... Okay, thank you, i will look into that page too
[08:13:25] <Lambda_Aurigae> the site you posted doesn't seem so complex but, pwm is not a simple subject really.
[08:13:42] <Lambda_Aurigae> look at several pages.
[08:13:54] <Lambda_Aurigae> read the datasheet
[08:14:27] <Lambda_Aurigae> always, first and foremost, read the datasheet, cover to cover, at least twice...once quickly to get an overview then again with an eye toward what you are wanting to do with the chip.
[08:15:45] <Lambda_Aurigae> the most important thing in learning is comprehension...do you understand what it is you are reading on that page?
[08:16:09] <Lambda_Aurigae> if not, then you need to go back a step and learn the terminology, learn the back story as it were.
[08:17:04] <Lambda_Aurigae> harry potter book 6 is a great book but a lot of it makes no sense if you haven't read the first 5 books.
[08:17:07] <tiblock> I do read, i see that prescaler things and i want to test them and example code is not working. Not very good. I will try that simplier code from your page
[08:17:55] <Lambda_Aurigae> and many of those tutorials out there, the one you posted and the one I posted included, come right from the datasheet.
[08:23:28] <Tom_itx> i'd rather just watch the movies
[08:24:01] <Lambda_Aurigae> Tom_itx, you heathen!
[08:24:43] <Lambda_Aurigae> you are probably a dog person too.
[08:28:13] <Tom_itx> not me.... http://tom-itx.no-ip.biz:81/~webpage/temp/misc/puppy1.jpg
[08:28:50] <Lambda_Aurigae> dogs drool, cats rule!
[08:29:53] <tiblock> Tryed that "Here is a sample ATmega8 code to setup TIMER 1 for a 4KHz" and still no PWM on any pin. Tested with LED and oscilloscope. I will try find working examples later. Thank you all for help
[08:30:27] <Lambda_Aurigae> sounds like something isn't setup right.
[08:30:57] <Lambda_Aurigae> probably hardware.
[08:33:32] <carabia> in an mp3 file of arbitrary sample size and rate, can a frame header start from an absolute offset that's not a multiple of 32?
[08:33:41] <tiblock> Will try fix it later, free time for playing with atmega for today ended
[08:35:25] <Tom_itx> now you get paid to do it?
[08:35:58] <carabia> yeah, shit's going down now
[11:39:56] <rue_house> Lambda_Aurigae, remember that if the jtag isn't disabled, a bunch of ports wont work right
[11:40:24] <Lambda_Aurigae> rue_house, yup...know that from the atmega32 of old...I'm not the one using jtag though.
[11:40:36] <rue_house> yea
[11:40:58] <rue_house> might wanna throw that at them next time things randomly dont work :)
[11:40:59] <Lambda_Aurigae> I was trying to get her/him/it to use the dragon as an ISP programmer to wipe the chip.
[11:41:32] <Lambda_Aurigae> they were getting jtag to step through the code but couldn't get it to program the chip..tells me the reset pin has issues most likely.
[11:42:11] <rue_house> I'v had issues where the onboard pullup resistor is too strong for the pogrammer
[11:42:24] <rue_house> so I use 10k instead of 1k on all my boards now
[11:43:52] <Lambda_Aurigae> have used 10K since I started.
[11:44:12] <rue_house> did tiblock know what #define F_CPU 1000000 does not actually set the clock to 1Mhz?
[11:44:35] <Lambda_Aurigae> rue_house, dunno...
[11:44:45] <rue_house> hmm
[11:44:54] <rue_house> I had fun with a tiny13 yesterday,
[11:44:54] <Lambda_Aurigae> he never responded if the chip was fresh or not.
[11:45:37] <rue_house> I thought the default was 1Mhz, then realized it was 9.6, but didn't know (used chip) if I'd set it to 4.8, but then realized by default the /8 is set
[11:45:41] <rue_house> the answer was 1.2Mhz
[11:45:55] <rue_house> and then my IR reciever worked :)
[11:46:02] <rue_house> buuut
[11:46:15] <rue_house> now I have to reverse engineer all the codes from the remote
[11:46:22] <Lambda_Aurigae> yeah..some of the newer tiny chips are not 1MHz.
[11:46:56] <rue_house> the tiny13 must have the newer core, its got pin change interrupts on all the pins
[11:47:21] <rue_house> I'm still waiting on the price of the 85 to come down
[11:47:38] <Lambda_Aurigae> yeah..it's a different aminal.
[12:01:26] <carabia> i was under the impression he had a 328, that doesn't even have jtag(??)
[12:03:04] <Lambda_Aurigae> carabia, is possible....maybe he was using 1-wire and thought it was jtag?
[12:04:02] <carabia> am i missing something here? when did he say anything about jtag?
[12:04:33] <Lambda_Aurigae> talking about two different people I do believe.
[12:04:44] <carabia> guess so hah
[12:04:51] <Lambda_Aurigae> tiblock was the frequency thingie.
[12:05:09] <carabia> yeah him, i thought it was related to him not getting the pwm working
[12:05:33] <Lambda_Aurigae> xPatsy was the jtag one
[12:05:46] <carabia> yea, but that's like a lifetimea go
[12:06:02] <carabia> i need a new keyboard this one's gonna give in any moment now
[12:06:05] <Lambda_Aurigae> with a butterfly...last night.
[12:10:05] <rue_house> 328 is an arduino :)
[12:11:44] <Lambda_Aurigae> yes..but the one with the jtag question last night was a butterfly...169 I think
[12:13:16] <_ami_> rue_house: t13a is really tiny. not sure if it can accommodate modern code. especially cpp fancy code.
[12:13:26] <_ami_> are you using asm on tiny13?
[12:13:52] <rue_house> hahaha
[12:14:10] <rue_house> nobody who knows what they are doing uses c++ on a microcontroller
[12:14:19] <rue_house> I'm using C
[12:14:28] <rue_house> I know its tight.
[12:14:32] <_ami_> :)
[12:14:38] <_ami_> C is pretty tight
[12:14:43] <rue_house> if I need to, I can compile the C to asm and optimize it
[12:15:18] <rue_house> gcc can be pretty crafty, but some of the silly things it does are crazy
[12:15:53] <_ami_> i am sure, you would have find bugs in gcc while optimizing code.
[12:16:18] <rue_house> just insane initializations and checks
[12:17:31] <carabia> 4 out 5 top software nerds recommend nodejs-on-avr(tm)
[12:18:09] <carabia> throw in some html, python and neil degrasse tyson
[12:18:22] <Thrashbarg> stop
[12:18:39] <carabia> which one was the trigger?
[12:18:59] <_ami_> carabia: i like python.. i am a seasonal py programmer.
[12:19:05] <Thrashbarg> carabia: all of it haha
[12:20:12] <_ami_> carabia: i just made a webserver using cherrypy for sending reports via email whenever esp12e finish the watering of my plants. http://45.251.50.237:8080/
[12:20:54] <carabia> haha
[12:21:37] <carabia> what was it called again? the rube goldberg machine
[12:23:36] <twnqx> http://pastebin.com/V53JKC0C the only code i ever used a tiny 13 for
[12:30:50] <rue_house> http://paste.debian.net/859418/
[12:31:03] <rue_house> there is a list of the C projects for tiny13 from my two servers
[12:31:55] <_ami_> twnqx: class blinky! ;)
[12:31:59] <_ami_> classic*
[12:32:28] <twnqx> _ami_: nonono!
[12:32:28] <rue_house> hmm I dont ahve the asm projects sorted by processor
[12:32:38] <twnqx> it's a watchdog timeout suppressor!
[12:33:45] <rue_house> hahaha my t13 asm stuff is mostly led flashers
[12:33:51] <carabia> charlie? where's tango? tango down
[12:34:12] <rue_house> do you know of charlieplexing?
[12:34:20] <rue_house> 6 leds with 3 io
[12:34:34] <carabia> yes i know of charlieplexing
[12:36:10] <rue_house> I wrote a program that works out things
[12:36:27] <rue_house> http://paste.debian.net/859419/
[12:36:52] <carabia> :D
[12:37:59] <rue_house> prevented having to think when writing the software
[12:38:59] <rue_house> hmm
[12:39:26] <rue_house> is git the thingiverse of source code?
[12:40:11] <rue_house> not quite the same is it?
[12:41:56] <rue_house> and what about schematics
[12:42:06] <rue_house> geez, 2 of 3 parts of this are missing
[12:44:19] <rue_house> why is debian pastebin being used as a chat server?
[12:54:24] <rue_house> hmm, some day I should make a trinary library
[12:55:14] <carabia> I think it's "ternary"
[12:55:18] <Chillum> ^
[12:55:23] <carabia> ^
[12:55:46] <Chillum> ternary is among my favourite words
[12:55:50] <carabia> :D
[12:56:04] <carabia> i find it going against the grain, really. Not my fav.
[12:57:08] <Chillum> I think that is why I like it
[12:57:32] <carabia> Hey so, has anyone worked with mp3 files?
[12:58:01] <carabia> A question I can't seem to find an answer for is am I guaranteed to find the first header contained in the first 32 bytes?
[12:58:15] <carabia> ...cause that'd be so sweet if it was like so.
[12:58:54] <Chillum> carabia: annoyingly they have more than one standard for headers
[12:59:16] <Chillum> It has been a few years but if I remember correctly they have a simple header system, then a more complex one for allowing meta-data
[12:59:56] <Chillum> I ended up using atomic parsley to parse it
[12:59:56] <rue_shop3> carabia, I thought about it, decided not to
[13:00:03] <rue_shop3> there is an mp3 decoder chip, and I have one, but never got it going
[13:00:13] <Chillum> or somethinkg similar
[13:00:14] <carabia> there's 32 bytes of header, followed by optional 16 bits crc
[13:00:20] <rue_shop3> dd you try the folks in #mpg123 ?
[13:00:32] <carabia> and then it seems like some encoders such as LAME can add some "aux data" after this, before the frame data
[13:00:45] <Chillum> riiight
[13:01:00] <Chillum> the header at the start is standard, but what comes after varies
[13:01:08] <carabia> but so it would appear that nothing can get prepended
[13:01:23] <Chillum> my trouble was trying to find the start of the actual sound data
[13:01:36] <carabia> all i'm really interested is am i guaranteed to find the first actual header at the start of the file or can there be some black magic padding
[13:01:55] <carabia> yeah, I found that bit on LAME off some forum. Didn't check its validity
[13:02:31] <carabia> rue_shop3: i have many a hw decoder for mp3s and flacs. Right now i'm doing sw decoding though
[13:03:37] <carabia> I'm gonna try that, rue_shop3
[13:05:08] <carabia> folks over at #ffmpeg-devel seem to be plentier.
[13:07:57] <twnqx> carabia: i'd answer the question with "no".
[13:08:09] <twnqx> but that's not coming from spec compliance, bit id3 tags
[13:08:29] <twnqx> but*
[13:08:54] <twnqx> in ye olden days, pirates also used to prepend the mp3s with whatever text they wanted, because all software just ignored it
[13:11:04] <rue_shop3> AAAAAAAAAAAAAARRRRRRRRRRRRRGGGGGGGGGGG
[13:11:15] <rue_shop3> the serial library I wrote was on the tiny26, not the 13
[13:14:11] <rue_shop3> heh, this could be interesting, bit banged serial on a 1.2Mhz avr
[13:17:58] <rue_shop3> hmm, there is only one timer, and my other code resets the value during operation
[13:19:22] <rue_shop3> 125 cycles for 9600 baud
[13:20:56] <rue_shop3> 9600 is the only one that divides properly
[13:21:00] <rue_shop3> hmm
[13:24:19] <rue_shop3> 125 cycles is
[13:24:44] <rue_shop3> 107 jump to next instruction and a nop
[13:45:30] <eszett> Hi!
[13:45:48] <eszett> I have a question, how can i easily check which pins of my Atmega are at the moment internally pulled up and which not?
[13:48:00] <antto> inject voltage to them thru a big resistor and measure them
[13:48:22] <eszett> oh no..
[13:48:31] <twnqx> i think the register is write-only :S
[13:48:35] <eszett> i mean check by software, is this possible?
[13:48:46] <antto> oh, in software
[13:48:51] <antto> no idea..
[13:48:54] <eszett> :-(
[13:49:28] <antto> wasn't there a register for those? can't it be read back?
[13:49:47] <antto> i think it's doable on an xmega, but.. so what ;P~
[13:50:48] <eszett> Im just using an Atmega32u4, and like to know if the reset pin is pulled up or not
[13:51:53] <antto> ah, the reset pin is usually special
[13:52:00] <eszett> ye
[13:52:05] <antto> i don't think you can control it
[13:52:09] <antto> or can you?
[13:52:10] <twnqx> yeah, my thought
[13:52:30] <twnqx> it's not "normally" an IO port without fuse changes, or is it?
[13:52:41] <eszett> I just want to check if the reset pin works with a pushbutton and the internal pullup, or if i need an external pullup, which i try to avoid
[13:53:27] <antto> it's certainly not usable on xmegas, there it's used as "reset" and as one of the PDI lines, clock i think, so definately no chance for "general purpose" usage
[13:53:34] <twnqx> if the data sheet says there is a pullup, there is on
[13:53:41] <twnqx> e
[13:54:04] <antto> yeah, they tend to have internal pullups, but you better check the datasheet to be certain
[13:54:28] <eszett> yes the datasheet.. that is where im a little bit challenged with
[13:54:48] <antto> i think it's also recommended to put an external pullup resistor anyways, there are reference schematic examples on how to put a reset button on it
[13:55:34] <antto> i know, i hate datasheets, nobody likes to RTFM..
[13:55:35] <eszett> ye
[13:56:18] <twnqx> let's just say there won't me a software method to determine that if it's not software controllable
[13:56:23] <twnqx> b*
[13:56:29] <eszett> For example i read something like "Port E is an 8-bit bi-directional I/O port with internal pull-up resistors ...", but what I would like to have an overview, so I dont have to read the whole datsheet from head to bottom ;-)(
[13:56:52] <antto> get xmega then
[13:57:15] <antto> and stay away from pic
[13:57:17] <eszett> twnqx: I see
[13:57:23] <antto> atmegas are somewhere in the middle
[13:57:38] <eszett> Are xmegas more expensive?
[13:58:12] <antto> maybe slightly, but they are generally bigger
[13:58:20] <antto> i think the smallest one is 16KB flash
[13:58:36] <eszett> 32kb should be enough for my purpose
[13:58:47] <antto> xmega32a4u then
[13:58:57] <twnqx> 640kb should be enough for everyone *g*
[13:59:15] <antto> what has 640KB flash?
[13:59:46] <Chillum> it is something Bill Gates was quoted as saying, though probably did not say
[13:59:58] <antto> oh
[14:00:15] <twnqx> talking about the ram limit (lower memory) of PCs.
[14:00:16] <Chillum> did you know he owns a lot of gates?
[14:00:20] <antto> yeah, you can write a whole book in 640KB
[14:00:28] <antto> as long as you don't use XML
[14:01:27] <twnqx> <sentence><word>But</word><word>I</word><word>like</word><word>XML</word></sentence>
[14:40:27] <rue_shop3> ok, its a tight loop, but I have a t13 doing 9600 baud serial...
[14:41:01] <antto> receive?
[14:41:05] <rue_shop3> no
[14:41:16] <antto> heh, transmit is le easy
[14:41:22] <rue_shop3> I just need it to tell me the codes for the remote control
[14:41:35] <rue_shop3> kinda, calibrating the tx delay was work
[14:42:00] <antto> true, not easy if you don't have a scope or somethin'
[14:42:19] <rue_shop3> ESP CAUSE SOMEONE TWISTED THE CALIBRATION KNOB FOR THE HORIZ SWEEP SPEED OF MY ANALOG SCOPE
[14:42:45] <rue_shop3> fun when you scope is out by about 210%
[15:17:51] <antto> ouch
[15:18:02] <antto> what an evil person
[15:34:34] <eszett> What is the differente between a "evaluation board" and a "development board"?
[15:38:21] <rue_shop3> hmm too much code for a tiny13
[15:45:53] <Tom_itx> dev board probably has more IO brought out
[15:46:09] <Tom_itx> eval board was intended for one thing probably
[15:46:20] <Tom_itx> not alot really
[15:52:44] <anonnumberanon> Would making a function "static" make it a lot faster to call it? Right now as a regular function it takes ages to get into it before the stuff inside is even executed.
[16:37:33] <rue_shop3> if you need a 1.2us delay PUT IT INLINE
[16:37:50] <rue_shop3> if you need a 400ms delay, call a function
[16:40:16] <Tom_itx> rue_shop3 what you workin on?
[16:43:09] <rue_shop3> trying to be outside while its not horrid weather
[16:43:12] <rue_shop3> cleaned off truck
[16:43:19] <rue_shop3> got genorator working
[16:43:34] <rue_shop3> and I'm back to the boiler and some avr code
[16:44:57] <Tom_itx> how's the boiler been working?
[16:45:11] <Tom_itx> any rust spots you had to replace since it went online?
[16:48:09] <antto> hey, don't expose your boiler to the internetz, someone's gonna h4x it
[17:40:52] <rue_shop3> the current one is shot
[17:41:08] <rue_shop3> I'm still building the new burner
[17:42:05] <rue_shop3> whats the last address on a 1k space
[17:42:08] <rue_shop3> 0x
[17:42:40] <rue_shop3> 0x400
[17:42:48] <rue_shop3> avrdude: ERROR: address 0x0410 out of range at line 65 of main.hex
[17:42:53] <rue_shop3> so, I'm about 16 bytes over
[17:43:47] <rue_shop3> oh no, I'm way over that
[17:43:55] <rue_shop3> :10046000A61BB70B881F991F5A95A9F780959095E1
[17:44:06] <rue_shop3> 0460
[17:44:24] <rue_shop3> or am I reading that right
[17:45:09] <rue_shop3> *sigh* might have to asm this one
[17:46:40] <rue_shop3> most of the crap that dosn't fit is gcc including all the math junk
[17:49:04] <hetii> Hello :)
[17:49:16] <eszett> hi
[17:50:12] <hetii> I cannot decide myself, should I use macros as a helpers for IO operation or should wrap it to function and pass as argument ?
[17:53:17] <eszett> depends on what your project is aimed for
[17:53:42] <hetii> well I think a bit about some generic library
[17:53:44] <eszett> and what the side-requirements are, like saving enegery, saving RAM, etc.
[17:54:12] <eszett> a macro is usually the more clumsy code snippet no?
[17:56:23] <hetii> yep, I think that macros are fine till don`t need reuse the same code for devices on different pins.
[17:56:57] <hetii> but I never had such situation where for eg I use two one wire buses
[17:57:47] <hetii> so probably my functions can use macros instead pass port information through functions
[17:58:30] <hetii> its just an example of course
[17:59:17] <Lambda_Aurigae> I think the complexity and programming style defines whether to use function or macro.
[18:00:17] <hetii> yep I agree :)
[18:01:15] <hetii> but today when I upgrade one of my project and I start thinking about it I cath myself that again I write/update some drivers that already use in the past
[18:01:42] <hetii> so instead be focused on application itself I do again the same work :/
[18:04:19] <hetii> thats why I decide to grab all devices from my project to single library and have common way to work with them ;)
[18:07:08] <rue_shop3> ok I have the programmable remote set to codes I can read and I'v worked out what they are for all buttons,
[18:07:57] <anonnumberanon> rue_shop3, YES I THINK THIS IS IT
[18:08:03] <anonnumberanon> I have to try it.
[18:11:02] <hetii> Btw my wife tomorrow give birth of our first baby so keep your fingers to be everything ok :)
[18:13:01] <hetii> wow https://www.youtube.com/watch?v=M2xzfomvDrk :)
[18:18:30] <hetii> ok time to sleep, see U.
[18:19:28] <Lambda_Aurigae> boy, girl, or other?
[18:19:38] <Lambda_Aurigae> perhaps triplets! one of each!
[18:20:28] <rue_shop3> break to trend, go with 3 other.
[19:26:29] <rue_shop3> and there we go, its a IR controlled set of 3 servos
[19:55:15] <anonnumberanon> nice
[19:59:15] <rue_shop3> not properly timed systems for the servo pulses, so they jitter when its recieving ir pulses, oh well
[20:13:19] * rue_shop3 hits his head on the tiny13's memory limit again
[20:15:30] <rue_shop3> y*3 -> (y*2)+y did it
[20:15:48] <rue_shop3> (gcc uses a shift instead of including the math library
[20:15:50] <rue_shop3> )
[20:33:06] <rue_shop3> hahah
[20:33:08] <rue_shop3> 03BF
[20:33:16] <rue_shop3> nooo more features for this code!
[20:33:31] <Lambda_Aurigae> you should get Jartza to help you make it smaller.
[20:33:36] <rue_shop3> oh drat, and I'm missing one of the controls I wanted
[20:37:01] <rue_shop3> I wnder if it can do it in the remaining ~32 bytes I have
[20:37:32] <Lambda_Aurigae> heck, you can put a brainfuck interpreter in 32 bytes dude!
[20:38:02] <rue_shop3> yea but I dont know if I have enought eeprom space for the bf program to do what I wnat
[20:39:41] <rue_shop3> avrdude: input file main.hex contains 1016 bytes
[20:39:44] <rue_shop3> ooo it fit
[20:40:49] <anonnumberanon> I need help to figure out why my bare chip is not programmed right unless I program it with an Arduino Uno. I use usbasp and avrdude (and upload some timer2 PWM code) with the following commands: https://paste.debian.net/hidden/efe0f5d1/
[20:41:55] <Lambda_Aurigae> and what speed is your chip running at?
[20:42:07] <Lambda_Aurigae> or, more properly,,,at what speed is your chip running?
[20:42:34] <Lambda_Aurigae> you might need to slow down the programming speed of the usbasp, if it supports such.
[20:43:05] <rue_shop3> anon, I have to leave for a bit, but I'll try my asp when I get back
[20:43:17] <Tom_itx> or add more waits
[20:43:50] <Lambda_Aurigae> I am off to bed here myself...have fun.
[20:44:18] <Tom_itx> party pooper
[20:45:09] <anonnumberanon> Lambda_Aurigae, it's a chip that used to have an Arduino bootloader and then I wanted to start using it with usbasp. I never did fusing though, if that counts. I have a 16 mhz connected to it on the breadboard.
[20:45:10] <Tom_itx> anonnumberanon, google what -B does for you
[20:45:45] <Tom_itx> you sure it's not running at 8Mhz?
[20:47:29] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/avr/avrdude/avrdude-doc-5.10.pdf
[20:47:46] <Tom_itx> -B
[20:47:46] <Tom_itx> bitclock
[20:47:46] <Tom_itx> Specify the bit clock period for the JTAG interface or the ISP clock
[20:57:12] <anonnumberanon> Should we assume the fuses have been set considering the chip was already bootloaded?
[20:57:54] <tiblock> Hi. Yesterday i was asking about PWM, if anybody curious, it is working now
[20:59:01] <anonnumberanon> ". In particular, the Dragon starts out with
[20:59:01] <anonnumberanon> a rather fast ISP clock frequency, so the
[20:59:01] <anonnumberanon> -B
[20:59:01] <anonnumberanon> bitclock
[20:59:02] <anonnumberanon> option might be required to achieve
[20:59:03] <anonnumberanon> a stable ISP communication"
[20:59:59] <anonnumberanon> coll tiblock :)
[21:00:40] <Tom_itx> the fuses were likely set since you can't have a bootloader without changing at least a couple
[21:02:02] <Tom_itx> also, the spi rate must be 1/4 the clock rate or less
[21:04:28] <anonnumberanon> yeah so fuses should be set for 16 Mhz, so I start from that, now to find a correct bitclock..
[21:06:23] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/usbtiny_programmer/testing_index.php
[21:06:26] <Tom_itx> read the bottom
[21:06:50] <Tom_itx> try -B 32
[21:16:52] <anonnumberanon> Nope.
[21:17:28] <Tom_itx> what errors?
[21:18:24] <anonnumberanon> No errors, just doesn't do what the program is supposed to do.
[21:19:15] <tiblock> Making board here, run out of space for photoresistor. But can you tell how bad this board made by newbie? http://i.imgur.com/pa08cSh.png
[21:20:47] <anonnumberanon> I can try one last thing: setting the fuses. Cause avrdude tells me in its log info that it does erase the chip first..
[21:22:08] <anonnumberanon> is your atmega328p USB enabled tiblock ?
[21:22:34] <anonnumberanon> Unless you're not using USB? I see the wires for it are cut in your circuit.
[21:22:36] <tiblock> anonnumberanon, no idea but USB there for power from portable power bank
[21:22:58] <anonnumberanon> Yeah okay if only for power than you are fine.
[21:26:43] <anonnumberanon> tiblock, how do you make this nice visualization?
[21:26:54] <tiblock> anonnumberanon, by the way, i have question. I want to pass VCC throught resistor into photoresistor and then another resistor to GND to divide voltage and read voltage level from ADC to know light level. What resistors i need? 1 kOhm will be fine? Will be able ADC to read voltage after 1 kOhm?
[21:27:07] <tiblock> anonnumberanon, its "sprint layout 6"
[21:28:37] <sabor> tiblock: why the voltage divider? the adc can convert from 0V to 5V if you use AVCC as positive reference
[21:28:55] <anonnumberanon> Uhm if I remember correctly ADC reads the voltage wherever you want to read it. So read it before and after the load.
[21:29:11] <sabor> just a resistor from +5V to adc pin and the photo resistor fro adc pin to GND will do
[21:29:46] <tiblock> sabor, as i understand when higher light gets on photoresistor then lower its resistance gets, so i need divide it to convert light level into voltage level
[21:30:16] <sabor> i'd start with something higher than 1kOhm, maybe 10k
[21:31:36] <sabor> right, when you have a lot of light it has maybe 100 ohms, when it's dark it has maybe 100kOhms or more
[21:31:53] <sabor> together with the pullup resistor you have your divider
[21:32:08] <Tom_itx> anonnumberanon, be careful with the fuses
[21:32:21] <Tom_itx> bitbanged programmers aren't extremely reliable
[21:32:39] <tiblock> I think i will investigate it later, at the moment i even don't know how to read ADC. Will look into that later when i will have board done
[21:33:02] <Tom_itx> try reading them firstr
[21:33:03] <rue_shop3> tiblock, want all my m328 source code as a reference?
[21:33:18] <anonnumberanon> Tom_itx, good thing I'm not using AtmegaTNT then.
[21:33:27] <tiblock> rue_shop3, thank you, but i will find manuals in google
[21:33:48] <rue_shop3> the datasheet tells you how to do it
[21:33:56] <rue_shop3> iirc there is even a code example
[21:33:59] <anonnumberanon> read the fuses, read the fuses, uhmmm okay
[21:34:29] <Tom_itx> anonnumberanon you could make a reliable programmer if you had a atmega32u2 etc
[21:36:04] <sabor> tiblock: i don't see a block capacitor on your pcb, put a 100nF capacitor between +5V and GND as near to the avr as possible
[21:36:34] <tiblock> sabor, ah, yes, thank you, forgot about that
[21:43:26] <anonnumberanon> Tom_itx, not with Atmega8u? That's what usbasp runs on.
[21:43:52] <Tom_itx> not enough space for the code
[21:45:15] <anonnumberanon> low: 0xff high: 0xda e-fuse: 0x5
[21:45:18] <Tom_itx> get a u2 breakout board from somebody and make one
[21:45:42] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/boards/USB_Breakout/USB_Breakout_index.php
[21:45:46] <Tom_itx> i made a bunch of those
[21:48:05] <Tom_itx> probably just the boot option modified in the fuses there.. i didn't look
[21:53:15] <anonnumberanon> "This fuse turns the Reset pin into a normal pin instead of a special pin. If you turn this fuse on you cant program the chip using ISP anymore. I would suggest you never set this fuse unless you really mean to." This would explain your warning :)
[21:53:50] <anonnumberanon> Nice breakout board.
[21:58:46] <Tom_itx> yeah they started letting us reuse the reset pin on some chips
[21:59:01] <Tom_itx> gotta kinda be careful with some settings
[22:01:12] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/boards/atmega32u4/atmega32u4_1.jpg
[22:01:16] <Tom_itx> i did a U4 too
[22:01:47] <Tom_itx> either one can make a programmer pretty easy
[22:02:20] <tiblock> sabor, i have 22uF ceramic capacitors, should i put it instead 100nF? Or bigger is not better in this case?
[22:03:30] <sabor> tiblock: no, bigger is not better, should be a ceramic 100nF
[22:03:41] <tiblock> Okay
[22:04:05] <sabor> 22uF sounds like electrolytic capacitor...
[22:05:28] <anonnumberanon> Huh the datasheet says that a chip erase does not alter the fuse bits.
[22:05:59] <Tom_itx> true
[22:06:35] <Tom_itx> oh..
[22:06:40] <Tom_itx> you said it had a bootloader?
[22:06:50] <Tom_itx> and now you are trying to use it as a regular chip?
[22:07:06] <Tom_itx> you need to reset the bootsector fuse if that is true
[22:07:21] <Tom_itx> i forgot exactly what it was called...
[22:07:40] <anonnumberanon> oh?
[22:07:46] <Tom_itx> absolutely
[22:08:04] <Tom_itx> otherwise you will load the code at 0x00 and it's not looking there to start running code
[22:08:22] <Tom_itx> read about the boot fuses
[22:08:23] <anonnumberanon> damn bootloader!
[22:08:29] <Tom_itx> you should only need to change one fuse bit
[22:08:37] <Tom_itx> what chip is it?
[22:08:54] <anonnumberanon> so it will be in one of low, high and extended bits? or it's another one completely?
[22:09:01] <anonnumberanon> im on a m3289
[22:09:05] <anonnumberanon> 328p
[22:09:22] <anonnumberanon> because I'm about to redo the fuses
[22:09:30] <Tom_itx> well hang on a sec
[22:09:36] <anonnumberanon> according to: https://www.youtube.com/watch?v=e_DoHqcENSs
[22:11:05] <Tom_itx> what are your current fuse settings again?
[22:11:51] <anonnumberanon> ow: 0xff high: 0xda e-fuse: 0x5
[22:12:09] <anonnumberanon> low: 0xff high: 0xda extended: 0x5
[22:12:12] <tiblock> sabor, 22nF is ceramic. I have electrolitic too, should i add one of them too? I have 1000uF 16v that will fit on PCB
[22:12:30] <Tom_itx> yeah see the boot reset vector is enabled
[22:12:30] <anonnumberanon> that's fine tiblock
[22:12:36] <Tom_itx> you need to clear that one
[22:12:39] <anonnumberanon> 22nF is for the crystal
[22:12:40] <Tom_itx> at least
[22:13:30] <Tom_itx> change HF: 0xDB
[22:13:33] <tiblock> anonnumberanon, i have 100nF, i have kit of about 64 values of them, i just though maybe bigger is better. Will use 100nF
[22:13:33] <Tom_itx> to clear it
[22:13:36] <Tom_itx> nothing else
[22:14:07] * anonnumberanon shivers
[22:14:37] <Tom_itx> http://www.engbedded.com/fusecalc/
[22:14:40] <Tom_itx> check it for yourself
[22:15:05] <anonnumberanon> yeah i was just on that page but see, i couldn't find my external crystal in that list
[22:15:08] <Tom_itx> make sure you leave SPI enabled
[22:15:14] <Tom_itx> it's ok
[22:15:20] <Tom_itx> don't worry about that right now
[22:15:46] <Tom_itx> you're using an external crystal?
[22:16:06] <Tom_itx> it is set right for that
[22:16:13] <anonnumberanon> yeah, this is pretty much an "arduino UNO on the breadboard"
[22:16:26] <Tom_itx> all you should need to do is that one fues
[22:18:29] <Casper> 22nf on crystal is wrong
[22:18:36] <Casper> 22pf is needed
[22:18:42] <Casper> 13-27pf
[22:18:44] <anonnumberanon> so -U hfuse:w:0xd9:m
[22:18:50] <anonnumberanon> no!
[22:18:55] <anonnumberanon> -U hfuse:w:0xdb:m
[22:18:59] <Casper> http://www.engbedded.com/fusecalc/
[22:19:02] <anonnumberanon> ^^ this is what I really meant heh.
[22:19:28] <Tom_itx> lemme check
[22:19:49] <Tom_itx> yeah
[22:20:01] <Tom_itx> that would explain why it seemed to load your program but did nothing
[22:20:09] <Tom_itx> it _did_ load it
[22:20:16] <Tom_itx> it just didn't know where to find it
[22:20:16] <anonnumberanon> yeah and yeah
[22:20:32] <anonnumberanon> so uhm ill do it now heh
[22:20:34] <Tom_itx> you actually shouldn't even need to reload the code
[22:20:41] <Tom_itx> just the fuse bit
[22:21:08] <anonnumberanon> wow?
[22:21:17] <Tom_itx> just remember if you ever go back to a bootloader you need to reset that fuse bit
[22:21:28] <anonnumberanon> yeah
[22:21:39] <Tom_itx> go look at the memory map for it and see what it does
[22:21:42] <anonnumberanon> I think I will play with these things anyway. I'll remember.
[22:21:48] <anonnumberanon> Cause it all makes sense.
[22:21:56] <Tom_itx> and you have the option for boot size as well
[22:22:05] <Tom_itx> in case you need more space for a larger bootloader
[22:23:03] <Tom_itx> so all those avrdude settings probably aren't needed
[22:23:07] <Tom_itx> the -B one
[22:26:17] <anonnumberanon> nope it wasn't fixed
[22:26:26] <Tom_itx> read the fuses now though
[22:26:31] <anonnumberanon> yeah
[22:27:57] <anonnumberanon> Yeah the fuse did change.
[22:28:02] <anonnumberanon> to 0xdb
[22:28:16] <Tom_itx> ok
[22:28:49] <Tom_itx> i wonder if there's something in the makefile you need to fix to relocate the code... i don't think so
[22:29:06] <Tom_itx> you could check and see if there's something odd in it
[22:31:08] <anonnumberanon> I reloaded the code.
[22:33:15] <Tom_itx> i'd try a simple blink thing until you know it works
[22:33:53] <anonnumberanon> Yeah I'll try that now
[22:33:58] <anonnumberanon> I have one handy.
[22:34:48] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/mega168_led_blink_delay_index.php
[22:34:54] <Tom_itx> there's a quick one
[22:36:00] <Tom_itx> those fuse settings listed there are likely the defaults ones for your chip too
[22:36:14] <Tom_itx> internal osc at the lowest freq with ckdiv8 enabled
[22:36:48] <anonnumberanon> so it doesnt matter if i have an external crystal hooked up?
[22:37:15] <Tom_itx> if you reset to the defaults i'd take it off but it probably doesn't matter
[22:37:20] <Tom_itx> i've left em on before
[22:38:03] <Tom_itx> check those against the fuse website to be sure
[22:39:16] <anonnumberanon> asm volatile ("nop");
[22:39:23] <anonnumberanon> is how i do it
[22:39:32] <anonnumberanon> u have asm volatile ("nop"::);
[22:40:53] <Tom_itx> change the define in the code if you use it to whatever clock you have
[22:45:21] <Tom_itx> ok, i'm out..
[22:47:21] <anonnumberanon> Does that make a millisecond delay?
[22:47:27] <anonnumberanon> That's what I get.
[22:58:10] <Tom_itx> approx i think
[23:08:37] <anonnumberanon> Man...this is so weird. So your program specifically runs but not another one which uses timer2 here: https://paste.debian.net/hidden/2efcb84a/
[23:08:51] <anonnumberanon> Note that if I upload it with Arduino, then it does work.