#avr | Logs for 2015-12-03

Back
[07:06:17] <Jartza> oh noes
[07:06:28] <Jartza> there's STILL some kind of bug in my full-screen scroll
[07:06:43] <Jartza> if I use it at full speed, I still lose some characters
[07:09:08] <Jartza> scrolling @12fps works fine but anything faster and I get some problems
[07:11:46] <Jartza> not acceptable ;)
[07:18:11] <merethan> Hi all
[07:21:58] <Jartza> hi
[07:25:02] <merethan> I am writing a CDC bootloader that's currently 6674 bytes in program memory and 1270 bytes in data memory (making the total flash needed 7946 bytes) but the programmer in AtmelStudio just won't write it to the 8k bootflash of my ATXmega256A3BU. I have the linker set up with .text=0x040000 so the program bits should go into the flash following the 256k mark. Are the data bits following the program bits by default or do I have to specify
[07:34:44] <merethan> "File contents does not map to any valid device memory for programming Flash"
[07:35:42] <merethan> Yet it (program bytes + data bytes) is under 8k, I don't get the error.
[07:38:27] <merethan> By "I don't get the error" I mean, I don't understand why I have it :)
[07:41:05] <Jartza> merethan: to me that sounds like you are using wrong MCU when compiling / linking
[07:41:09] <Jartza> or faulty linker script
[07:48:16] <DKordic> merethan: ``program'' is FLASH, and ``data'' is EEPROM'', right?
[07:49:04] <DKordic> Lock Bits? Have You completely erased the chip first?
[07:49:06] <merethan> No, data as in program data, not program instructions.
[07:49:14] <merethan> Havard arch remember...
[07:49:32] <DKordic> So that means EEPROM?
[07:49:33] <merethan> But I found the problem. It's a really nasty bug in AtmelStudio
[07:49:51] <merethan> A stupid one too.
[07:50:07] <DKordic> I am not surprised at all.
[07:55:22] <merethan> Setting .text=0x40000 (yes I am writing a bootloader) in the config dialogs (Alt-F7) results in -Wl,-section-start=.text=0x80000 on the linker commandline. Then you just keep wondering why the flasher won’t write your program to your chip..
[07:55:38] <merethan> Really confusing.
[07:57:51] <merethan> Adding -Wl,-section-start=.text=0x40000 yourself and removing the .text=0x40000 setting from the GUI fixes it.
[08:44:53] <Haohmaru> words vs bytes?
[08:57:22] <merethan> Atmel wants me to make an account of some sort to take a bug report.
[08:57:29] <merethan> Because email is too easy.
[09:08:34] <Haohmaru> yeah, they wanted an account even for downloading atmel studio
[09:57:31] <tekkkz> Hello! I'm on xmega128a3u and i want to measure a 100k ntc thermistor via adc, but for some reason its not working. see here: https://bpaste.net/show/3418b6088596
[09:57:46] <tekkkz> can you help me getti ng it to work?
[09:58:46] <cehteh> what does not work?
[10:00:45] <tekkkz> i dont know
[10:00:52] <tekkkz> in my code im trying to do:
[10:01:07] <tekkkz> if (ADCPoll()==0)
[10:01:07] <tekkkz> PORTB.OUT |= PIN0_bm;
[10:01:22] <tekkkz> and it gets stuck on this line and is not enabling the connected led there
[10:05:02] <DKordic> Maybe interrupt is triggered, and clears flag, before that poll loop?
[10:05:43] <tekkkz> huh?
[10:06:28] <cehteh> thats not your whole code right?
[10:06:55] <cehteh> anyway i'd prefer to read the adc via interrupt and timer
[10:07:27] <tekkkz> yeah
[10:07:33] <tekkkz> thats not my whole code
[10:08:01] <cehteh> also how did you conntect the ntc? has the xmega differential inputs? i'd prolly use that for better use of the 12bit range
[10:08:29] <tekkkz> what? atm i dont have connected this. just connected to GND for test measurement
[10:08:36] <tekkkz> on PB7
[10:09:52] <cehteh> another thing is das the bandgap reference and adc need a few cycles before stabilizing, first reads might be wrong
[10:10:19] <tekkkz> yeah but anyway it is not doing anything when i cann ADCPoll
[10:10:30] <cehteh> yeah that was unrelated
[10:10:52] <tekkkz> no
[10:10:59] <tekkkz> cause even if there are wrong measurements
[10:11:03] <cehteh> so how about interrupt driven adc reads?
[10:11:04] <tekkkz> it should get out of the poll
[10:11:11] <cehteh> instead polling
[10:11:26] <tekkkz> man i didnt used adc ever before, im beginner and i have no clue what you are talking about
[10:12:13] <cehteh> you read the datasheet?
[10:12:18] <tekkkz> sure
[10:12:59] <cehteh> basically you can trigger the ADC to start a conversion, when that conversion is finished it generates a interrupt
[10:13:48] <cehteh> and in that interrupt handler you can read the result, possibly average it/oversampoing and store it ready to use for your application
[10:14:46] <cehteh> triggering the ADC can be done in different ways, freerunning, from other (timer) interrupts or whatever
[10:17:27] <tekkkz> okay so could you please give me a little example or fix my code for your idea?
[10:17:32] <tekkkz> ***PLEASE****
[10:19:00] <cehteh> well not that little .. i have some code to protect a Lipo battery and switch the output off when the voltage falls below a limit and thats for a attiny45 bit xmega so registers are slightly different
[10:19:10] <cehteh> but the principle is the same
[10:19:16] <cehteh> http://git.pipapo.org/?p=battswitch.git;a=blob;f=src/battswitch.c
[10:19:26] <tekkkz> hm ok maybe i can be successful with your example
[10:19:28] <cehteh> at the very end are the interrupt handlers
[12:43:53] <sweeper> blar. anyone have experience with ch341-uart throwing "avrdude: Cannot get serial port settings. ioctl returned -1", even though the kernel shows it as connected?
[12:45:15] <sweeper> hmm
[12:45:22] <sweeper> supposedly something about usb 3? o.O
[12:47:30] <sweeper> no, that seems to be a different issue...
[12:55:21] <sweeper> http://savannah.nongnu.org/bugs/?44248 <-- D:
[13:14:28] <sweeper> yep, confirmed. 6.0.1 fixes my problem
[19:14:07] * LeoNerd decides to buy himself a copy of Horowitz&Hill for Christmas
[20:14:36] <jaggz> I have to set my com5 settings in windows each time I connect my promicro (atmega32u4) ..
[20:14:50] <jaggz> anyone know how to make those set automatically? I used their default .inf file
[20:15:07] <jaggz> (the first one on this page) http://www.fourwalledcubicle.com/files/LUFA/Doc/140928/html/_page__o_s_drivers.html
[20:15:48] <Casper> save the parameters in your program that open the com port?
[20:16:53] <jaggz> Casper: I can work around it, yeah.. but really when it connects it should get the settings automatically no?
[20:17:13] <jaggz> maybe I'm wrong.. maybe it's always up to the "terminal program" to set the values
[20:18:14] <Casper> no
[20:18:39] <Casper> the default is most likelly 9600 8n1 with possibly flow control enabled
[20:18:45] <jaggz> yeah.. disabled in this case