#avr | Logs for 2015-08-18

Back
[00:00:21] <fobboyandy> avrdude -B seems to be the option
[00:00:35] <fobboyandy> i've tried very small numbers like 1 all the way to 1000
[00:00:46] <fobboyandy> still doesn't seem to be able to find a connection
[00:07:25] <Casper> what about 10000?
[00:08:33] <fobboyandy> tried
[00:09:08] <fobboyandy> i ll just study up on fuse bits more
[00:09:15] <fobboyandy> and try again on a new one
[00:09:43] <fobboyandy> when i know more about it i ll probably realize what i did wrong
[00:11:16] <Casper> the programmer clock must be less than 1/4 the main clock
[00:11:45] <fobboyandy> well originally it used to be 8/8
[00:12:05] <Casper> hmm
[00:12:06] <fobboyandy> with the crystal it's 12/8 so it's still greater than what it used to be
[00:12:08] <Casper> true...
[00:12:46] <fobboyandy> should i use the fuse bit calculator? or should i just set them by doing pen and pencil and datasheet?
[00:12:58] <fobboyandy> that way i only mess with what i'm supposed to
[00:13:41] <Casper> the calculator is confusing imo
[00:14:15] <fobboyandy> do you usually just follow datasheets and figure out the bits manually?
[00:15:24] <Casper> ya
[00:16:03] <fobboyandy> have you done any vusb projects before?
[00:17:45] <fobboyandy> there aren't enough tutorials out there. kind of difficult to learn only from source codes
[00:18:54] <Casper> usb scare me
[00:18:55] <Casper> btw
[00:19:07] <Casper> the xtal2 pin is an input and will accept an external clock
[00:19:20] <Casper> you can feed it a clock there and see if the avr respond
[00:22:23] <fobboyandy> ok
[00:22:40] <fobboyandy> originally the clock is at 8mhz internally
[00:23:16] <fobboyandy> i will just remove the /8 on a new uC to get the 8mhz to drive the dead one
[00:23:17] <fobboyandy> lets try
[00:23:40] <fobboyandy> if this doesn't work then i give up
[00:40:36] <fobboyandy> I GIVE UP
[00:41:43] <Casper> no!
[00:43:00] <fobboyandy> maybe i chose something wrong on the calculator
[00:43:30] <fobboyandy> i m gonna try setting fuse bits on a new one tomorrow. am not giving up on setting fuse bits
[00:43:51] <fobboyandy> just giving up on reviving that dead one
[00:46:15] <Jartza> I use ff df ff fuse settings for atttiny85 external crystal
[00:46:42] <fobboyandy> do you use the calculator or naaaaww?
[00:47:04] <fobboyandy> am pretty sure i messed up because i didn't know how to use the calculator properly
[00:47:39] <Jartza> yes I do
[00:47:49] <Jartza> avrcalc.pl
[00:48:19] <Jartza> I usually select the slowest start-up time
[00:48:42] <fobboyandy> what about the other check boxes?
[00:49:25] <fobboyandy> the only thing i changed on the calculator was the clock source. i chose ext crystal oscillator with the option all the way at the bottom
[00:49:46] <fobboyandy> i kept everything else the same and used the resulting fuse bits
[00:50:03] <fobboyandy> and bam dead tiny85 after i burned the fuse in
[00:53:23] <fobboyandy> anyways i'm off to sleep. thanks for your help anyway capser and jartza
[03:08:52] <Haohmaru> something is unclear to me.. usually it seems eeproms need quite some time to write stuff.. yet in the xmega datasheet it says the internal eeprom can be written in a few cycles o_O
[03:08:56] <Haohmaru> am i missing something?
[03:53:28] <Valen> I think its the erase that takes the time Haohmaru, also eeproms have come a long way
[03:57:32] <Haohmaru> okay.. my real question is.. i use eeprom_update_block() to save a structure..
[03:58:10] <Haohmaru> afaiu, this would read the data from the eeprom and compare to see which bytes really need to be updated.. okay
[03:58:28] <Haohmaru> but is the actual update done per byte, or per page?
[03:59:04] <Xark> Haohmaru: For eeprom on AVR per byte I believe (flash is per page).
[03:59:55] <Haohmaru> so does that mean that each byte which is found to be different would be "updated" which would cause the whole 32 byte page it resides in to be "updated" too?
[04:03:49] <Haohmaru> because if it is so, then it would be better to write my own version of update_block() which would update whole pages, once each page..
[04:05:43] <Xark> Haohmaru: I don't think EEPROM has "pages".
[04:05:53] <Xark> (on AVR)
[04:07:47] <Haohmaru> it says it in the datasheet for the xmega32a4u - 1K eeprom, 32 byte page size, 32 pages
[04:17:32] <Xark> Haohmaru: Interesting. Well, I would finish reading the datasheet and see if you can gain an advantage writing pages (but I wasn't aware of it).
[04:23:51] <Haohmaru> if updating a single byte requires writing the whole page (and that's how i understand it is when speaking of external eeprom chips) then it would be dumb
[04:24:26] <Haohmaru> imagine it happens that all 32 bytes need to be updated within a page.. update_block() would re-write the page 32 times?
[04:25:07] <Haohmaru> this can't be good, given that the internal eeprom is rated with a lower endurance compared to external eeproms
[07:23:14] <twnqx> guys
[07:23:34] <twnqx> do you think one can fit an I2C slave into a CPLD? or will you need the size of an fpga for that?
[08:04:02] <Yoduza> CPLD?
[08:04:21] <Yoduza> I2C support slave and master mode
[08:07:29] <aandrew> if you make some shortcuts I could see one of the two fitting maybe
[11:11:52] <Lambda_Aurigae> twnqx, depends on the CPLD really. I've seen some pretty big ones.
[11:14:18] <fobboyandy> hi guys. when i set the fuse bits to use an external CRYSTAL, does the crystal oscillator circuit have to be attached to xtal1 and xtal2 before i burn the fuses?
[11:15:48] <fobboyandy> i did this yesterday without hooking up the crystal first. not sure if this caused the microcontroller to die or if maybe i just messed up on the fuse bits
[11:35:40] <hetii> HI :)
[11:37:06] <hetii> Q: is it possible to talk over microsd controler like via SPI ?
[11:37:32] <Chillum> yes
[11:37:43] <Chillum> I have used microsds with SPI before
[11:39:20] <hetii> but what I mean is not a driver microsd card from microcontroler but use any generic microsd reader with some custom kernel driver to expose his data lines and have in that way SPI interface
[11:40:02] <Chillum> oh, no idea
[11:40:23] <Chillum> you mean access it through a USB interface?
[11:40:41] <Chillum> ah, nm. No idea what you mean
[11:40:57] <hetii> yes, if they use usb then yes
[11:44:29] <Chillum> the vusb library allows generic usb emulation
[11:44:33] <Chillum> but it will be very low level
[11:44:48] <hetii> no, I don`t mean to use vusb...
[11:44:56] <hetii> its not needed in this case.
[11:45:14] <hetii> imagine that I have a SD card reader
[11:45:25] <hetii> and whant to use it as a bridge to SPI interface
[11:47:12] <Chillum> why though? You can just directly use the SPI interface without a reader
[11:47:39] <Chillum> I don't know how readers work, if they just passively re-map the wire then no problem, but I don't know what they do
[11:48:20] <Chillum> I just took a microsd-sd converter cards and soldered pin header to the bottom
[11:48:37] <Chillum> the cheap ones that come with microsd cards
[11:52:45] <hetii> The idea is that I will use my reader that is already builded in my PC and use his SPI interface to drive some other third party uc.
[11:52:52] <hetii> Just some odd Idea :)
[12:07:02] <Chillum> oh.. that is an odd idea
[12:07:22] <Chillum> well, it should be possible
[12:07:55] <Chillum> I have always wondered if you can build a microcontroller that pretends to be a disk but instead of returning static information it returns dynamically created information when a file is accessed
[12:30:22] <Jartza> Chillum: friend of mine was doing something similar around a year ago to his customer
[12:30:44] <Jartza> like a camera, that looks like usb flash drive to computer
[12:31:00] <Jartza> and when you read the file, the content is captured from the camera sensor
[12:44:17] <fobboyandy> YES1111!!!
[12:44:22] <fobboyandy> I DID IT!
[12:44:52] <fobboyandy> AFTER BRICKING ONE OF MY ATTINYS I FINALLY SET THE FUSES CORRECTLY THIS TIME!
[12:45:00] <fobboyandy> yeah am a noob
[12:45:18] <Chillum> Jartza: that is a great idea, it could hook up to one of those printers that prints from memory cards
[12:45:44] <Chillum> fobboyandy: it is tricky changing clock settings
[12:46:20] <Chillum> I have a breadboard with it all setup, I should make a custom programmer PCB though
[12:47:45] <Chillum> I have to get a sop-8 socket adapter, right now I am programming attiny85(the surface mount ones) by holding them against the pcb with one hand and pressing "Enter" with the other
[13:12:22] <Jartza> why custom?
[13:12:36] <Jartza> why not isptouch or standard 6-pin isp-header?
[13:29:28] <Chillum> Jartza: making it is half the fun
[13:29:38] <Chillum> and I already have all the parts, pcb is cheap
[13:30:01] <Jartza> mmkay
[13:30:04] <Chillum> and I have a nice Zero Insertion Force holder for dips, and a socket adapter for soc-* stuff coming
[13:30:17] <Chillum> sop
[13:30:56] <Jartza> yeah
[13:31:20] <Chillum> I am working on a tiny SMD USB keyboard emulator
[13:31:29] <Chillum> the board is smaller than the usb plug
[13:31:51] <Chillum> it can type anything you program it to but I am going to make it turn CAPS LOCK on and off at random
[13:31:54] <Chillum> like a prank device
[13:32:03] <Chillum> it wiLL BUG THe hell out of peopLE
[13:32:46] <Jartza> hehe
[13:32:54] <Jartza> sounds like a prank device I made for my boss :D
[13:33:11] <Jartza> attiny85 (soic-8) and v-usb
[13:33:24] <Jartza> it randomly types "shit"
[13:34:09] <Jartza> or well, it sleeps from 15 to 45 minutes between writes
[13:34:46] <Jartza> plugged that into the back of my bosses pc
[13:35:20] <Jartza> he was "very pleased" after 7 hours when he finally realized
[13:35:23] <Jartza> :D
[13:38:56] <hetii> lol
[13:49:59] <Jartza> fortunately by boss has good sense of humor
[13:56:07] <fobboyandy> lol
[13:56:24] <fobboyandy> i m about to do that to my roommate
[13:56:41] <fobboyandy> except i want it to move the mouse randomly but just slightly to mess him up when he plays fps games
[14:00:12] <hetii> My idea long time ago was to build some keylogger that will pass keyevents but alos transmit them over wifi by esp8266 :)
[14:01:41] <fobboyandy> why didn't you make it?
[14:20:26] <RikusW> hi fobboyandy
[14:21:16] <fobboyandy> hey rikus
[14:21:22] <fobboyandy> how's it going? any new projects?
[14:22:20] <RikusW> no, apart from fetching cows, to move them to a different pasture
[14:22:31] <RikusW> err no new projects
[14:22:39] <RikusW> going ok :)
[14:22:51] <fobboyandy> lol make a cow fetcher
[14:23:09] <RikusW> living on a fard does have its perks :)
[14:23:11] <fobboyandy> vusb stuff is so annoying. my computer never recognizes the devices
[14:23:18] <RikusW> no noisy neighbors
[14:23:49] <RikusW> did you make sure the external circuits is correct ?
[14:23:52] <hetii> fobboyandy: no time and after all, no real needs :)
[14:25:01] <fobboyandy> pretty sure. maybe i gotta install this driver
[14:25:03] <fobboyandy> lemme try that
[14:26:19] <RikusW> windows might need some inf file at least
[14:27:03] <RikusW> if it is listed as unknown device and windows displays the correct PID and VID you are almost there
[14:27:21] <RikusW> just need the inf file or driver
[14:28:36] <fobboyandy> vid0000pid0002
[14:28:45] <fobboyandy> that's not correct right?
[14:29:48] <fobboyandy> nope it's not. i checked against usbconfig
[14:30:26] <RikusW> what should the vusb device's be ?
[14:31:14] <fobboyandy> its from http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/
[14:31:29] <fobboyandy> i don't know how to write my own yet so i can only build other people's and try to understand it
[14:31:39] <fobboyandy> but nothing has worked so far
[14:34:52] <hetii> the most critical things to understand in usb, is to know how to prepare usb descriptors
[14:35:02] <hetii> imho :
[14:35:03] <hetii> )
[14:36:03] <fobboyandy> can i create a main file that's empty and only edit the usb descriptor? would the computer still recognize?
[14:38:25] <fobboyandy> hetii: do you have any attiny85 vusb device that i can try? none of the ones i found online works
[14:39:52] <hetii> you can grab my keysender by: git clone https://hetii@bitbucket.org/hetii/keysender.git
[14:40:09] <hetii> and try co change it for attiny85
[14:41:45] <fobboyandy> what did you use for the mcu
[14:41:59] <hetii> for that project I used atmega8
[14:42:00] <fobboyandy> not sure if attiny will have enough pin outs for the actual circuit
[14:42:33] <hetii> sure, not but you don`t need to use that project just part from it
[14:44:04] <fobboyandy> i don't really understand enough to use parts of the code yet
[14:44:38] <fobboyandy> how did you begin learning vusb?
[14:45:25] <fobboyandy> there's barely any tutorials out there other than that guy joonas
[14:46:14] <fobboyandy> omg i plugged it into another computer and it actually read the name of the device USBexample
[14:48:28] <fobboyandy> but it's a school computer so it won't let me install the driver >.< but at least it recognized it
[14:49:41] <RikusW> and he is off to tell his friends... ;)
[14:51:04] <hetii> hmm
[14:51:27] <hetii> and I start strip down my code for him and he is gone now ...
[14:55:36] <fobboyandy> i switched over to linux
[14:55:57] * RikusW uses Mint :)
[14:56:19] <RikusW> I haven't booted win7 in a long time
[14:56:49] <fobboyandy> lol mine is 8.1
[14:56:56] <fobboyandy> linux detected it
[14:56:57] <fobboyandy> wow
[14:57:12] <fobboyandy> but stupid windows 8.1 wasn't accepting the connection
[14:57:18] <fobboyandy> windows 7 on school computer also worked
[14:57:37] <RikusW> seems like w8 just became even more painful to use...
[14:57:51] <fobboyandy> lol
[14:57:54] <RikusW> I don't even want to mess with win10
[14:57:56] <fobboyandy> you do know that theres windows 10 right?
[14:58:00] <fobboyandy> lol
[14:58:09] <fobboyandy> that's what am starting to think too
[14:58:18] <fobboyandy> i was about to upgrade to win 10 soon too
[14:58:19] <RikusW> win 7 is the last one I used, I still prefer XP
[14:58:29] <fobboyandy> lol xp. those were the times
[14:58:40] <RikusW> I still run it in a virtualbox
[14:59:02] <fobboyandy> i remember when i was a kid and used the windows classic and the xp came out, i hated how xp looked
[14:59:12] <RikusW> the win95 explorer was the best imo
[14:59:24] <fobboyandy> lol what do you need in the older versions tho?
[14:59:50] <RikusW> win95 doesn't even support usb properly...
[15:00:04] <Emil_> Do you have an example of how to communicate with the atmega32u4
[15:00:06] <Emil_> through usb
[15:00:07] <RikusW> XP works fine for me in the virtualbox though
[15:00:20] <RikusW> Emil_: whats on the 32u4 ?
[15:00:31] <Emil_> integrated usb controller
[15:00:34] <fobboyandy> yes, through an arduino lol
[15:00:34] <Emil_> fullspeed
[15:00:38] <Emil_> fobboyandy: : (
[15:00:45] <RikusW> and which firmware ?
[15:00:47] <Emil_> I'm looking for a pure C solution
[15:00:51] <Emil_> RikusW: ?
[15:00:59] <Emil_> what do you mean which firmware?
[15:01:10] <fobboyandy> how do you install a usb driver on linux
[15:01:14] <RikusW> You'll need to load something like Atmel's USB CDC code to get a virtual serial porrt
[15:01:24] <RikusW> or HID code or something else
[15:01:24] <Emil_> Oh lol
[15:01:31] <RikusW> or use LUFA
[15:01:31] <Emil_> No no no
[15:01:42] <hetii> fobboyandy: I strip down my code for you: http://paste.linuxmint.com/view/fh8k/
[15:02:44] <Yoduza> hetii, this code for atmega32u4 ?
[15:02:45] <hetii> in main() you have a pointer like: char *s = ""; this is a string that can be emited over vusb to your pc
[15:03:10] <hetii> It should work for any avr where v-usb is used
[15:03:39] <hetii> just set proper pins in usbconfig
[15:03:45] <fobboyandy> hetii: i actually got my computer to recognize the usb device by booting to linux
[15:03:56] <fobboyandy> i ll use your code soon
[15:04:05] <fobboyandy> as soon as i figure out how to install the usb driver on linux
[15:04:22] <hetii> well my code don`t need any dirvers
[15:04:29] <RikusW> fobboyandy: what type of usb device are you trying to make ?
[15:04:37] <hetii> it act as a HID device(in this case as keyboard and mouse)
[15:04:44] <RikusW> linux generally got builtin drivers
[15:04:49] <hetii> and emit characters like you will press keyboard
[15:04:49] <RikusW> no need to install
[15:05:05] <RikusW> until you need to install a driver, then it can be a nightmare
[15:07:58] <fobboyandy> hetii: the circuit diagram is also included in your github right? or bitbucket
[15:08:14] <fobboyandy> rikusW: i don't even know what this device does yet lol
[15:08:24] <fobboyandy> got it off the tutorial. just trying to learn and follow along
[15:08:42] <fobboyandy> but i think this device is supposed to be able to turn an led on and off using the computer command line
[15:09:18] <hetii> not realy, http://www.elektroda.pl/rtvforum/viewtopic.php?t=3055071&highlight=
[15:10:05] <hetii> this device was used to lern commands from any infared remote controler and swith HDD that are plugged to TV
[15:10:32] <hetii> but as I said I just strip it down to code that should allow you send just keys over usb
[15:10:32] <fobboyandy> how did you learn the basics of vusb?
[15:10:38] <fobboyandy> there aren't enough tutorials out there
[15:10:53] <hetii> I use other project codes to see how they are made
[15:11:45] <fobboyandy> rikusW: there is this exe given along with the device that i built. but on linux i can't run it
[15:11:51] <hetii> the tricky things about HID over v-usb is in that when you send a character code then you need to send empty buffor to notify PC that you unrelease key
[15:12:25] <fobboyandy> i have the source code in c but i can't compile it because it uses a library called windows.h
[15:12:33] <fobboyandy> idk where to find it yet
[15:12:43] <fobboyandy> i hope windows.h doesn't mean windows from microsoft
[15:13:00] <fobboyandy> unrelease?
[15:13:11] <fobboyandy> does that mean pressed?
[15:13:54] <hetii> when you press a key you should send his code and after that send second empty frame
[15:14:14] <hetii> otherwise it will act like you will keep key pressed all the time
[15:14:40] <hetii> ok I need to go for a while, will back in 1:30h
[15:14:42] <Emil_> But is that vusb still serial over usb
[15:14:44] <Emil_> or is it usb usb
[15:14:59] <fobboyandy> hetii: kk c ya. thanks for your help
[15:15:26] <hetii> Emil_: depends on your needs you can use CDC class and have it as a serial device on PC side
[15:15:40] <hetii> in my code I emulate keyboard and mouse so HID device
[15:16:11] <RikusW> fobboyandy: windows.h means you need to install visual studio....
[15:16:32] <Emil_> hetii: How do you send stuff to a mouse and a keyboard?
[15:16:38] <RikusW> the exe is probably to interface to the devince
[15:16:41] <RikusW> *device
[15:17:12] <RikusW> therre should be some docs about controlling HID from Linux
[15:17:47] <hetii> Emil_: not to he mouse and keyboard but I emulate those devices.
[15:18:12] <hetii> *the.
[15:18:14] <fobboyandy> rikusw: good idea i ll look through the docs
[15:18:24] <hetii> ok see you soon.
[15:19:46] <Yoduza> what kind of compiler need for that code ?
[15:20:40] <Yoduza> avr-gcc ?
[15:20:55] <Yoduza> gcc-avr ?
[15:23:33] <RikusW> avr-gcc
[15:24:17] <fobboyandy> rikusw: brb going back to windows. no clue how to control this thing on linux
[15:26:12] <Yoduza> why windows dont asking about cert on VID:PID installing new device ?
[15:26:52] <fobboyandy> yeah it does. but this device comes with a software that controls the led
[15:27:07] <fobboyandy> it has an exe but no .out file that i can run on linux
[15:30:48] <Yoduza> what is the .dll in windows for connect to device via "HID device" interface ?
[15:31:48] <fobboyandy> am not sure. why? HID device drivers are already preinstalled why mess with it?
[15:33:10] <fobboyandy> brb going on windows
[15:46:30] <Jartza> https://www.dropbox.com/s/7jl6jctqpzqmhcm/VID_20150818_1335.mp4?dl=0
[15:46:47] <Jartza> "pipes screensaver" :)
[15:51:11] <fobboyandy> rikusW:i found this "Now if you are doing this project on a Linux box, congratulations, you likely can just get LibUSB and compile the command-line client to talk to your new device."
[15:51:22] <fobboyandy> compile the command_line client but how
[15:51:46] <RikusW> probably .configure then make
[15:51:53] <RikusW> there should be a readme file
[15:52:00] <RikusW> ./configure
[15:58:24] <fobboyandy> oh my lord let me stick to hid devices for now
[15:58:29] <fobboyandy> time to start over
[16:04:19] <RikusW> CDC is a bit easier, a simple serial port
[16:15:48] <fobboyandy> i ll do that when i do stronger usb devices. i want something generic for now
[16:16:08] <fobboyandy> anyways i ll be gone for a while rikus so see you later or next time
[16:26:38] <Jartza> https://www.dropbox.com/s/82fmm4bgx1jmtcj/VID_20150818_9977.mp4?dl=0
[17:35:11] <hetii> hmm
[17:36:45] <hetii> wonder, what will be faster. Talk two uC and use hardware SPI or connect them together via 8 bit lines for data and some additional one to control flow ?
[17:39:30] <hetii> This is interesting: http://avrprogrammers.com/articles/avr-high-speed-communication
[18:12:17] <Jartza> well
[18:12:33] <Jartza> https://www.dropbox.com/s/mwni2oabo59hxn5/VID_20150819_8345.mp4
[18:12:56] <Jartza> finally video that shows the real colors
[19:04:31] <fobboyandy> anyone good with fuse bits can help me?
[19:05:28] <fobboyandy> i set my fuses to this PLL mode which turned my mcu to 16mhz and now i set it back to default
[19:05:36] <fobboyandy> but the speed is still really fast
[19:06:10] <fobboyandy> i made a blinking program to test it. supposed to blink once a second but now its rapidly blinking
[19:06:58] <Casper> like 8 times faster? maybe you dind't reenabled the div8 fuse%
[19:07:04] <fobboyandy> hey casper
[19:07:18] <fobboyandy> haha nvm i got it. i unplugged the mcu and plugged it back in
[19:07:31] <fobboyandy> and the oscillation reset back to normal
[19:07:34] * Casper wonders if he should hide or say hi...
[19:07:49] <fobboyandy> LOL
[19:08:01] <fobboyandy> a real ghost
[19:08:40] <fobboyandy> so yeah i set the fuse to oscillate really fast, then set it back to default and it wont go back to normal. then i unplugged the mcu and plugged back in, then it's fixed
[19:09:17] <fobboyandy> and also i got the mcu to use crystals now. used pen pencil like u suggested
[19:11:04] <fobboyandy> Casper: is it just me or does the mcu doesn't keep time that well
[19:11:45] <fobboyandy> i set the blinking to 1 flash per sec but it doesn't match up with the ticking of the clock. it was first in sync for a while then it goes out of sync
[19:11:52] <fobboyandy> and goes back into sync and out again
[19:27:04] <Lambda_Aurigae> fobboyandy, are you using crystal or internal rc oscillator and how are you figuring your 1 second flash?
[19:27:49] <fobboyandy> internal
[19:27:58] <fobboyandy> while(1)
[19:27:58] <fobboyandy> {
[19:27:58] <fobboyandy> PORTB = 0b00000001; //blink on pin 1
[19:27:58] <fobboyandy> _delay_ms(500);
[19:27:58] <fobboyandy> PORTB = 0b00000000;
[19:27:58] <fobboyandy> _delay_ms(500);
[19:27:59] <fobboyandy> }
[19:28:36] <fobboyandy> it's not super super inaccurate but it's not very accurate either. about every 8 seconds it would go out of sync
[19:29:09] <Lambda_Aurigae> well,
[19:29:21] <Lambda_Aurigae> internal RC oscillator isn't exactly super stable for starters.
[19:29:52] <Lambda_Aurigae> and that _delay_ms() isn't exactly exact either.
[19:30:20] <Lambda_Aurigae> and there are a lot of other things going on between your _delay_ms() entries that make your loop longer than 1 second.
[19:30:45] <fobboyandy> so it's normal?
[19:30:48] <Lambda_Aurigae> the while loop, setting the outputs, all take time.
[19:31:25] <Lambda_Aurigae> if you want to do it more accurately then use timer interrupts.
[19:31:29] <fobboyandy> i attached the output to an arduino and wrote some arduino code to output the delay time to the serial monitor
[19:31:47] <fobboyandy> it was only off by 1 millisecond
[19:32:55] <fobboyandy> i used arduino to mark the time the output went high then started counting until it goes low and print out the amount of miliseconds to see if the delay i wrote in my code matches the delay counted by arduino
[19:33:13] <fobboyandy> the outputs were 500+-1
[19:35:33] <fobboyandy> but i guess 500 ms cycles weren't long enough to start noticing deviation
[19:35:59] <fobboyandy> maybe if i set the delay to 10 seconds i would see 50 ms difference