#avr | Logs for 2015-02-04

Back
[01:38:31] <anonnumberanon> Hi.
[01:38:40] <anonnumberanon> I solved all my problems today gents.
[01:38:49] <Casper> Low.
[01:39:21] <anonnumberanon> High.
[01:41:53] <Casper> PWM frequency was 10 times too high I guess?
[01:42:00] <Casper> 50Hz, not 500Hz...
[01:42:54] <anonnumberanon> No we just had trouble interfacing the ESC.
[01:43:03] <anonnumberanon> Releasing vid in one minute.
[01:43:56] <anonnumberanon> Here https://vid.me/EFur
[01:49:42] <jacekowski> what was the problem?
[01:53:30] <Casper> I guess the problem is too long to describe in words... you knows... a picture is worth a thousands words, so his video must be worth a few millions words?
[01:56:49] <anonnumberanon> Only connections to an ESC are white to PWM+ and black to ground of the PWM source. We thought we had to power the red cable but it is actually power coming out of it that supposedly is used to run the receiver and maybe other things. We are not using radio controlled capabilities so unplugging red did it.
[01:58:05] <Casper> but double check your PWM...
[01:58:24] <Casper> normally it's 50Hz, 1-2ms high pulse...
[01:58:53] <Casper> you said 500Hz 1-2ms... which... sound wrong... however there is a few "un"standard
[02:00:49] <anonnumberanon> apparently 50 Hz is the minimum frequency. Some people on forums claimed 300Hz, 400Hz and some others above. We tried 500Hz and it worked.
[02:01:09] <anonnumberanon> I don't know how to change that frequency though.
[02:01:22] <anonnumberanon> All I know is that I have access to 500Hz and 1000Hz.
[02:04:09] <anonnumberanon> Analog Discovery is a great tool for $99 by the way.
[02:10:58] <malinus> anonnumberanon: it sure is. My school made me buy it, but I don't regret it at all. Sure you can't compare it with a real scope, but for the money it's great
[02:11:52] <anonnumberanon> yeah
[02:12:49] <malinus> it's especially great if you are doing sub-20mhz digital stuff, or slow analog stuff (sound etc.)
[02:12:55] <anonnumberanon> I'm looking into capturing serial at 115200 baud now, not sure what to do. the analog discovery seemed to capture only 2000 data when I should have gotten about half a million points in 5 seconds.
[02:13:44] <malinus> anonnumberanon: it doesn't have infinite memory depth
[02:13:47] <atommann> I meet something strange with AVR's Timer 1. fast pwm mode.
[02:14:19] <anonnumberanon> malinus, I was hoping it could dump the data onto my computer
[02:14:57] <anonnumberanon> eventually I'll have to do heavy calculations on the data but now a data log of about 5 seconds is my next step.
[02:15:39] <atommann> the code is here http://pastebin.com/5EVymnGy
[02:15:40] <malinus> anonnumberanon: well it can, but as far as I understand it, the data still needs to get buffered trough the device. Your only option is probably to change the time frame (to lower).
[02:16:21] <atommann> If I put OCR1A = 1200; between TCCR1A and TCCR1B, the freq. is 45.45kHz.
[02:16:53] <atommann> If I put OCR1A = 1200; after TCCR1A and TCCR1B, it is 6.667kHz which is correct according to the datasheet.
[04:36:16] <STS_Patrik> why do i get "integer overflow in expression[-Woverflow]" warning in AS6 (and my programme fails) when trying to do
[04:36:18] <STS_Patrik> UBRR = ( ( CLK / ( 16 * 9600 )) - 1 );
[04:36:33] <STS_Patrik> UBRR = ( ( CLK / ( 153600 )) - 1 ); works just fine, which should be the same?
[04:36:57] <STS_Patrik> UBRR & CLK is uint32_t's. Device is AT90CAN128
[04:39:40] <STS_Patrik> co-worker found explanation, UBRR = ( ( CLK / ( 16 * 9600L )) - 1 ); worked as well
[08:11:31] <Jartza> 'allo
[13:37:18] <d-rock> Looking for a little help with differential ADC reads on an atmega2560
[13:38:00] <d-rock> I'm using an arduino board, but using the registers directly (not analogRead)
[13:38:45] <woodyj21> I've only played w/ UNO's, but what's the issue?
[13:38:46] <d-rock> I set things based on reading the spec sheet to use the 2.56V ref, not free-running, but it seems like everything after the second read returns the same values
[13:39:18] <d-rock> I turn on the ADC, set MUX and ref params, then set ADSC
[13:39:43] <d-rock> Wait for ADIF to go high, then read ADCH, then ADCL (not using ADLAR)
[13:40:30] <woodyj21> 'fraid that one goes over my head.
[13:41:03] <d-rock> One thing I'm trying to figure out is if the gain is pre- or post-differential
[13:41:05] <woodyj21> someone else here might give it a go tho
[13:41:09] <d-rock> Hope so :)
[13:41:46] <d-rock> I'm trying to get the differential ADC to work so that I can get rid of some op-amps I currently need
[13:42:04] <d-rock> single-end ADC works fine with input from an instrumentation amp
[14:00:53] <d-rock> It gets stranger
[14:01:35] <d-rock> I just switched to reading ADC instead of ADCH/ADCL individually and now it's working, but the values are all over the place with a 0mV differential
[14:02:16] <d-rock> Ahhhh, wait, 10 bits unsiged
[14:02:18] <d-rock> unsigned
[16:11:49] <LeoNerd> Where can I find a good description of the 'SLEEP' instruction? and specifically, its interaction with the global interrupt flag
[16:12:26] <LeoNerd> I'm pondering whether it can support an operation analogous to ppoll(2), or whether it suffers the fundamental race-condition problem with poll(2) that causes ppoll to be required in the first place
[16:12:44] <LeoNerd> Namely: Can you *atomically* test if there's interrupts pending, and if not, sleep?
[16:30:05] <LeoNerd> Well, in any case, I want to write a system that does: wait for PCINT on one of the ports, then wait a further 500µsec, then read the state of most of the GPIO pins and update some in-memory state. If that state is different to "last time", hit a GPIO pin to serve as an IRQ to (the other MCU on my board)
[16:30:17] <LeoNerd> Concurrently: service inbound I2C-style requests on the USI
[16:30:21] <LeoNerd> OHyes, this is on a tiny2313
[16:38:52] <LeoNerd> Wow, quiet today...
[16:38:57] <LeoNerd> Nobody has any thoughts? :)
[16:46:10] <Tom_itx> you didn't offer a penny
[16:46:12] <Tom_itx> :D
[16:46:25] <Tom_itx> and i'm keeping my 2c worth
[18:42:28] <totalanni> Tom_itx
[18:42:31] <totalanni> are you around?
[18:46:35] <Tom_itx> no
[18:48:34] <totalanni> my atmel studio isnt finding the programmer
[18:49:04] <Tom_itx> then you don't have the jungo driver installed properly
[18:49:20] <totalanni> its listed under jungo
[18:49:24] <totalanni> with no ?'s
[18:49:38] <totalanni> and it Shows up in studio, just doesnt work
[18:49:43] <Tom_itx> then it should work
[18:50:13] <Tom_itx> can you select it?
[18:50:20] <totalanni> yes
[18:50:35] <Tom_itx> what part are you programming?
[18:50:44] <totalanni> ?
[18:50:50] <totalanni> im triyng to program a hex to flash
[18:50:55] <Tom_itx> what avr chip
[18:51:13] <totalanni> xmega384c3
[18:51:52] <Tom_itx> is it PDI ?
[18:51:55] <totalanni> yes
[18:52:10] <totalanni> and when i select it, studio selects pdi
[18:52:14] <Tom_itx> when you select the programmer and that chip what programming options show up?
[18:52:17] <Tom_itx> ok
[18:52:26] <Tom_itx> maybe your pinout isn't right
[18:52:42] <Tom_itx> because so far all indicatons show the programmer is working
[18:52:44] <totalanni> its standard pdi pinout
[18:52:57] <totalanni> 1s
[18:53:58] <Tom_itx> what OS what ver studio?
[18:54:55] <Tom_itx> i don't have a 64bit os to test on...
[18:55:45] <totalanni> ah
[18:55:47] <Lambda_Auriga_> not like this helps or anything, but, my Tom_itx programmer works on 64bit ubuntu linux with 8bit avr chips...
[18:55:47] <totalanni> it says
[18:55:52] <totalanni> Unable to connect to tool AVRISP mkII (000200212345)
[18:56:14] <totalanni> Timestamp: 2015-02-04 19:34:55.544
[18:56:15] <totalanni> Severity: ERROR
[18:56:15] <totalanni> ComponentId: 20100
[18:56:15] <totalanni> StatusCode: 1
[18:56:15] <totalanni> ModuleName: TCF (TCF command: Tool:connect failed.)
[18:56:15] <totalanni> Could not establish communication with the tool.
[18:56:34] <totalanni> pinout is correct
[18:56:50] <Tom_itx> slow down the spi clock
[18:56:57] <Tom_itx> that's odd
[18:57:09] <Tom_itx> i tested it just before i sent it
[18:57:35] <totalanni> how do i slow it down?
[18:57:47] <Tom_itx> there should be a dialog box
[18:57:55] <Tom_itx> err maybe that's just on ISP
[18:58:47] <totalanni> where is the firmware
[18:58:55] <totalanni> for avrdude and atmel versions
[18:58:58] <totalanni> ill try avrdude
[18:59:57] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[19:00:14] <Tom_itx> you want the 2nd one
[19:00:30] <Tom_itx> 131027 avrdude-5.15 version
[19:00:55] <totalanni> does it work with avrdude 6.0.1?
[19:01:20] <Tom_itx> yeah
[19:01:28] <Tom_itx> anything above 5.10
[19:01:49] <Tom_itx> you'll have to swap usb drivers and that just opens a can of worms
[19:02:28] <totalanni> its a usbtiny right?
[19:02:35] <Tom_itx> no
[19:02:38] <Tom_itx> avrisp2
[19:02:50] <totalanni> err
[19:02:51] <totalanni> sorry
[19:02:58] <totalanni> what chip does it have
[19:03:00] <totalanni> in flip
[19:03:11] <Tom_itx> atmega32u2
[19:03:51] <totalanni> says cant open usb dev
[19:03:56] <totalanni> maybe its this usb3 shit
[19:04:10] <Tom_itx> that could be
[19:04:18] <Tom_itx> maybe it's too fast
[19:04:43] <Tom_itx> because it sees the programmer
[19:04:50] <Tom_itx> and studio recognizes it
[19:07:33] <totalanni> still no work
[19:08:02] <Tom_L> does it show up under the jungo driver now?
[19:08:25] <totalanni> yes
[19:08:30] <totalanni> mkii
[19:08:33] <Tom_L> then avrdude won't work
[19:08:38] <Tom_L> you need to fix that
[19:08:47] <totalanni> still trying studio
[19:08:52] <Tom_L> it needs the libusb driver for avrdude
[19:08:53] <Tom_L> ok
[19:08:57] <totalanni> rather use it
[19:09:03] <Tom_L> did you swap firmware?
[19:09:11] <totalanni> no
[19:09:19] <totalanni> but i might ahvbe installed libusb prior
[19:09:19] <Tom_L> the avrdude firmware won't work under studio
[19:09:27] <totalanni> would that mess up my studio?
[19:09:36] <Tom_L> it could but i can't say that it did
[19:09:40] <Tom_L> i have had it happen
[19:09:47] <totalanni> let me try avrdude
[19:09:48] <totalanni> brb
[19:09:48] <Tom_L> i had to reinstall studio
[19:11:31] <totalanni> i installl it into flash
[19:11:34] <totalanni> not eeprom
[19:11:35] <totalanni> right
[19:11:40] <Tom_L> yes
[19:11:41] <totalanni> with flip
[19:11:50] <Tom_L> erase before write
[19:13:55] <Tom_itx> do you have an older pc you could try it on?
[19:14:06] <Tom_itx> just to see if it's the USB3 port
[19:14:21] <totalanni> i moved it to a usb2
[19:14:48] <totalanni> its still staying under jungo
[19:14:51] <totalanni> afte ri flashed it
[19:14:58] <totalanni> shouldnt it say avrisp?
[19:15:02] <Tom_L> well you gotta change the driver
[19:15:17] <Tom_L> disable jungo and enable libusb
[19:15:22] <Tom_L> if you're trying avrdude
[19:15:33] * Tom_L the lid is off the can of worms
[19:16:29] <totalanni> where is libusb
[19:18:08] <totalanni> god im confused
[19:18:14] <totalanni> its still showing up in studio
[19:18:19] <totalanni> im going to flash it back to studio
[19:18:21] <totalanni> and reboot
[19:18:31] <Tom_L> good idea
[19:18:38] <totalanni> should i have the avr hooked up the whole time?
[19:18:51] <Tom_L> you can
[19:19:07] <totalanni> whats studio rescuse?
[19:19:11] <Tom_L> don't use that
[19:19:16] <Tom_L> that's for some old boards
[19:19:20] <Tom_L> not needed now
[19:19:21] <totalanni> kk
[19:19:21] <totalanni> brb
[19:19:37] <totalanni> should
[19:19:44] <totalanni> i disable "windriver" under jungo?
[19:19:55] <totalanni> its listed with the mkii
[19:20:51] <Tom_L> not if you're gonna use studio
[19:21:12] <Tom_L> see the problem comes that neither driver want's to let go of it
[19:21:13] <totalanni> so dont
[19:21:28] <Tom_L> jungo is for studio
[19:21:43] <totalanni> so leave bot windriver and mkii enabled
[19:21:54] <Tom_L> windriver?
[19:22:11] <totalanni> brb
[19:22:13] <totalanni> lemme reboot
[19:22:59] <Tom_L> oh.. yeah that's normal
[19:27:53] <totalanni> no luck so far tom
[19:27:58] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/avr/jungo.jpg
[19:28:03] <Tom_L> that's what you see
[19:28:11] <totalanni> yesd
[19:28:23] <Tom_L> studio sees it then
[19:28:29] <totalanni> it does
[19:28:45] <totalanni> when i goto
[19:29:00] <totalanni> tools -> dev programming -> avrisp mkii -> my chip
[19:29:24] <totalanni> and hit apply
[19:29:30] <totalanni> it says cant find mkii
[19:29:35] <totalanni> you want to teamview?
[19:29:45] <Tom_L> naw
[19:30:02] <totalanni> ?
[19:30:23] <totalanni> this is what studio says
[19:30:25] <totalanni> Unable to connect to tool AVRISP mkII (000200212345)
[19:30:51] <Tom_L> what studio version?
[19:31:00] <totalanni> 6.2
[19:31:33] <Tom_L> i'm waiting for studio to start
[19:31:36] <Tom_L> it may be an hour
[19:33:51] <totalanni> might just be this win 8.1
[19:33:56] <totalanni> gonna try a fresh vm
[19:34:11] <Tom_L> umm
[19:34:21] <Tom_L> are you using studio under linux?
[19:34:35] <Tom_L> because that won't work
[19:35:00] <Tom_L> i just tried mine in studio 6.2 and it works fine
[19:36:30] <totalanni> widnwos
[19:36:44] <totalanni> what version of windows?
[19:45:46] <Tom_L> haha
[19:45:47] <Tom_L> xp
[19:48:53] <totalanni> sigh
[19:49:20] <Tom_L> are you running it in a vm?
[19:49:26] <totalanni> im about to
[19:49:32] <Tom_L> it won't work
[19:49:36] <totalanni> im loading a xp vm now
[19:49:44] <totalanni> why not?
[19:49:54] <totalanni> sigh
[19:49:58] <Tom_L> ask some linux guru but i'm told it won't
[19:50:22] <Tom_L> if you got linux why not use avrdude there?
[19:50:39] <Tom_L> you don't have to change the firmware on the programmer
[19:50:48] <totalanni> i dont
[19:50:52] <totalanni> i use win8.1
[19:51:44] <totalanni> brb
[19:51:56] <Tom_L> i know guys have used windows 8 but i don't have it
[20:01:31] <totalanni> Tom_itx
[20:01:36] <totalanni> in an attempt to start over
[20:01:52] <totalanni> i removed and unintallled all their drivers from dev. manager
[20:01:58] <totalanni> now all i have is the mkii with a ? mark
[20:02:03] <totalanni> and no "windriver"
[20:02:26] <totalanni> and the programmer is flashed to studio mode
[20:16:32] <totalanni> no lcuk
[20:16:36] <totalanni> gonna try a vm
[20:16:38] <totalanni> with xp
[20:19:53] <Tom_L> worth a shot i guess
[20:20:06] <totalanni> i prob messed something up
[20:20:18] <totalanni> when i was trying to get my uno to act like an avrisp
[20:20:26] <totalanni> i dunno
[20:20:43] <totalanni> i should just be able to install atmel studio, plug it in, and it work.... right/
[20:20:44] <Tom_L> it's either the usb driver or the usb port i suspect
[20:20:48] <Tom_L> yep
[20:21:14] <totalanni> and the dev. im programming doesnt have to be "starting up"
[20:21:23] <totalanni> it can just be on for how ever long
[20:21:34] <totalanni> r?
[20:23:50] <Tom_L> ?
[20:23:59] <Tom_L> i don't see why not
[20:24:07] <Tom_L> i'd unhook the target for now
[20:24:16] <Tom_L> get the drivers ironed out again
[20:24:33] <totalanni> yea
[20:24:44] <totalanni> sorry im not an advanced programmer
[20:24:49] <totalanni> and asking alot of stupid ?
[20:25:20] <totalanni> this xp vm will be done in like 15
[20:25:24] <totalanni> ill bbiab
[20:25:38] <Tom_L> no problem
[20:52:51] <totalanni> Tom_itx
[20:52:57] <totalanni> vcc is the red wire
[20:53:03] <totalanni> correct?
[20:59:16] <Tom_L> pin1 is the red wire
[20:59:46] <Tom_L> just a sec
[21:00:30] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/6pin_isp.jpg
[21:00:41] <Tom_L> err wait...
[21:00:52] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/6pin_PDI.jpg
[21:00:56] <Tom_L> pin 1 is DATA
[21:00:59] <Tom_L> pin2 is VCC
[21:01:43] <Tom_L> pin1 red DATA
[21:01:51] <Tom_L> on the ribbon cable
[21:04:40] <totalanni> ok
[21:04:44] <totalanni> everything is connected ritht
[21:04:54] <totalanni> i even flashed the avrdude hex
[21:05:11] <totalanni> and it still jut shows mkii and win driver in device managers
[21:05:20] <totalanni> im hoping this vm will work
[21:05:22] * totalanni shrugs
[21:05:50] <Tom_L> but the avrdude hex won't work in studio
[21:05:59] <Tom_L> even if it shows up under the driver
[21:06:34] <Tom_L> you got the ribbon plugged into the PDI plug on the programmer right?
[21:07:00] <totalanni> yup
[21:07:07] <totalanni> both sides only go 1 way
[21:07:08] <totalanni> lol
[21:08:08] <totalanni> the light on the programmer is green
[21:08:28] <totalanni> using target power
[21:09:38] <Tom_L> that's normal
[21:09:54] <Tom_L> the pwr led is red and that indicated 5v to the target
[21:10:10] <Tom_L> you don't want that for xmega
[21:12:34] <totalanni> im uploading you images
[21:13:46] <totalanni> http://imgur.com/bcscUhI,mmK6Ads,nPypC5e#0
[21:15:07] <totalanni> last error is when i hit apply
[21:17:08] <Tom_L> for the heck of it select a different avr part
[21:17:16] <Tom_L> unhook your tartget first
[21:17:31] <totalanni> ?
[21:17:42] <totalanni> avr part?
[21:17:47] <Tom_L> in the programming dialog
[21:17:56] <Tom_L> select a different target part
[21:18:13] <Tom_L> device
[21:18:19] <totalanni> i tried com1
[21:18:22] <Tom_L> no no
[21:18:24] <totalanni> not simulator thou
[21:18:24] <Tom_L> don't do that
[21:18:39] <Tom_L> that shouldn't even be available
[21:19:34] <totalanni> simulator seems to be working
[21:19:36] <totalanni> O.ol
[21:21:40] <totalanni> NM
[21:21:53] <totalanni> sigh
[21:33:35] <totalanni> 0.
[21:33:36] <totalanni> +.
[21:37:20] <totalanni> Tom_itx
[21:37:31] <totalanni> on a fresh windows 8.1 format
[21:37:40] <totalanni> all i need to install is atmel studio
[21:37:52] <totalanni> for the programmer to work
[21:37:54] <totalanni> correct?
[22:00:38] <Tom_itx> yes
[22:01:05] <Tom_itx> and make sure you have the original firmware loaded in the programmer
[22:01:21] <Tom_itx> 131027 Windows Studio version(hex)
[22:09:59] <totalanni> yup
[22:10:12] <totalanni> one more time for shits and giggles
[22:12:04] <totalanni> could have i messed up the eeprom?
[22:12:21] <totalanni> with flop
[22:12:23] <totalanni> flip
[22:16:32] <Tom_itx> i doubt it
[22:16:52] <Tom_itx> unless you messed with other sections besides flash
[22:17:34] <totalanni> i might have done an eeprom on accident
[22:18:02] <totalanni> can i get a copy of the eeprom?
[22:18:59] <Tom_itx> did you push the 'select eeprom' button?
[22:19:10] <totalanni> yes...
[22:19:16] <totalanni> and i might have prog flash to it
[22:19:20] <Tom_itx> :/
[22:19:31] <totalanni> sorry
[22:19:35] <totalanni> im new to all of this
[22:19:38] <Tom_itx> select eeprom and erase it
[22:19:57] <Tom_itx> then select flash and erase it and program the hex to it
[22:20:00] <Tom_itx> see if that works
[22:20:03] <totalanni> it greys out erase when i select eeprom
[22:20:26] <Tom_itx> well select flash and erase it
[22:20:31] <Tom_itx> then try programming it again
[22:20:35] <Tom_itx> see what happens
[22:21:18] <Tom_itx> then push 'start application' and see if the programmer green led comes on
[22:21:26] <totalanni> it does
[22:21:35] <Tom_itx> it should be ok then
[22:21:43] <totalanni> it just doesnt work in studio
[22:21:58] <Tom_itx> same as before?
[22:22:02] <Tom_itx> studio sees it?
[22:22:08] <Tom_itx> i don't understand that
[22:22:11] <totalanni> under tool
[22:22:15] <totalanni> but when i click apply
[22:22:19] <totalanni> it says it cant find it
[22:22:30] <totalanni> unable to connect
[22:22:47] <Tom_itx> if it didn't see it it should be greyed out or not on the list
[22:23:16] <totalanni> yes
[22:23:35] <totalanni> im going to try to get a vm installed
[22:23:42] <Tom_itx> i'm somewhat stumped
[22:23:47] <totalanni> and pass through the usb to the vm
[22:23:56] <totalanni> maybe my main has some weird drivers
[22:36:56] <totalanni> sigh
[22:37:08] <totalanni> stupid studio
[22:37:21] <totalanni> what libusb do i need to avrdude?
[22:39:02] <Tom_itx> do you have the arduino stuff?
[22:39:38] <totalanni> laying around
[22:39:47] <Tom_itx> i've used the one that comes with it
[22:39:58] <Tom_itx> beyond that the one i tested is way old
[22:40:53] <Tom_itx> it also has avrdude with it
[22:41:48] <Tom_itx> gonna call it a night here.
[22:42:06] <totalanni> aight
[22:42:10] <totalanni> thanks for the helop
[22:43:07] <Tom_itx> if you don't get it soon, i could grab my kid's surface pro and install studio on it and try it
[22:43:25] <Tom_itx> i dunno if it would work on it or not