#avr | Logs for 2015-08-27

Back
[00:25:46] <postmodern> do i need external full-swing crystal fuse setting for a 8Mhz crystal oscillator?
[00:26:01] <postmodern> or just one of the external 8Mhz crystal osc fuse settings?
[00:26:12] <postmodern> for the atmega328p, of course
[00:26:19] <Casper> full swing
[00:26:31] <Casper> else you can have stability issue in the clock
[02:12:52] <postmodern> so after switching to an external 8Mhz crystal oscillator, i can receive UART, but after a while it becomes corrupted
[02:43:09] <Xark> postmodern: Like totally, or occasional garbage char?
[02:44:07] <postmodern> Xark, more like shuffled or missing characters
[02:44:13] <postmodern> Xark, so might be a timing issue?
[02:44:37] <Xark> Or lack of handshaking.
[02:44:59] <Xark> If you can, as a test, try adding a delay between sending characters.
[02:45:40] <postmodern> Xark, hmm i am doing 500ms delays in between sending whole strings
[02:46:00] <Xark> How long are the strings?
[02:56:13] <postmodern> Xark, ~20 chars
[02:56:40] <postmodern> Xark, if i unplug everything and unplug the TTL cable, then turn it back on, UART works fine
[02:57:08] <Xark> I see. Well, maybe it is an electrical problem.
[02:57:26] <Xark> Memory corruption/overflow?
[02:59:27] <postmodern> likely an electrical thing, since resetting it doesn't fix the problem
[02:59:41] <postmodern> i wonder if the TTL cable is leaking voltage in via GND
[05:35:31] <Lambda_Aurigae> the earlier uart problem...try adjusting the UBBR one up or down and see what happens.
[10:19:02] <theg4sh1> Hi, all! What would be better in main loop (pseudo, #define bufsize 64; char buf[bufsize]; int i=0;): for(;;) { read(buf, bufsize); do_smth_other(); } or for(;;) { read((buf + i++), 1); do_smth_other(); } ? Sorry for oneliner.
[10:19:52] <theg4sh1> I meant reading all incoming bytes per circle or by one.
[10:27:28] <bss36504> I think it's just personal preference. Whatever you want your interface to be.
[14:19:05] <Yoduza> completely asm instructions manul ATmega328. PDF ?
[14:21:10] <ali1234> http://www.atmel.com/images/Atmel-0856-AVR-Instruction-Set-Manual.pdf
[14:24:06] <Yoduza> ali1234, respect ! 152 pages.
[14:28:29] <sebus> gotta question - might be related to avr or not to be honest. I need a book or something related with mixing audio samples. Any good resources how to do it in pure C on avr?
[14:29:59] <Yoduza> sebus, http://www.twirpx.com/about/search/?searchid=139800&text=ATmega328
[14:31:37] <ali1234> sebus: you just add the samples together... done
[14:32:21] <sebus> ali1234 ok, but what if some samples got decimal 255 and output is based on 8 bit dac?
[14:32:37] <ali1234> then you must normalize somehow
[14:32:38] <sebus> ad7528 here
[14:33:03] <sebus> alike doing 1/2 per sample?
[14:33:11] <ali1234> right
[14:33:18] <ali1234> divide each sample by 2, then ad them
[14:33:25] <ali1234> that's one possible strategy
[14:33:28] <sebus> someone pointed me to find something about amiga playback on avr
[14:33:43] <ali1234> oh, i think i have seen that project
[14:34:02] <ali1234> what are you actually trying to do?
[14:38:56] <sebus> ali1234 i want to make a simple synthesizer for use with 48k speccy as addon card
[14:42:30] <Yoduza> addon card for what ?
[14:42:47] <sebus> for my old zx spectrum 48k
[14:42:50] <sebus> 8 bit machine
[14:42:54] <Yoduza> wow
[14:43:38] <sebus> instead of using ay chips for playback/making music
[14:43:58] <Yoduza> what kind of chips used in zx spectrum 48k ?
[14:44:38] <sebus> z80, ferranti (ula chip, can be done on about 50+ ttl chips which handle keyboard, ram, graphics)
[14:44:38] <Yoduza> zilog z80 as cpu. Memory ?
[14:44:48] <sebus> dram memory 48k and rom
[14:46:02] <sebus> ram divided into two blocks (16k + 32k)
[14:48:39] <sebus> my speccy has generic OKI ramchips, all socketed, requires 3 different Vccs -.-
[14:48:45] <sebus> iirc 5V, -5V, 12V
[14:49:01] <sebus> done by simple switching circuit
[17:35:26] <postmodern> i'm reading the time from a DS1307 over i2c, but the time always comes back as 00:00:00. I'm using this library (https://github.com/akafugu/ds_rtc_lib/tree/master/library-gcc) on an atmega328p
[17:36:14] <postmodern> i can confirm there is i2c data being transmitted, and the crystal oscillator is emitting every 1s
[18:29:14] <hetii> Hey :)
[18:29:38] <hetii> I know its a wrong # but maybe some of you will have idea: pastebin.ca/3132616
[18:29:47] <hetii> Q: any idea how to write now a kernel driver that will talk with this firmware?:)
[18:36:10] <aandrew> it's not that straightforward
[18:36:18] <aandrew> that cypress device is just a "gateway"
[18:37:05] <aandrew> you need to know how the MT2060 and WJCE6353 are connected, and how the firmware in the FX2LP interprets the USB endpoint data
[18:37:40] <aandrew> you can figure this out by sniffing the USB traffic in Windows and emulating it in Linux
[18:38:10] <aandrew> to do that you use software such as usbpcap or usblyzer
[18:38:16] <aandrew> I've used the latter with pretty good success
[18:42:38] <hetii> hmm
[18:42:49] <hetii> ok will need to play with it
[18:43:05] <hetii> I found also a cycfx2prog tool
[18:43:10] <hetii> that allow dump a ram
[18:43:32] <hetii> so as I assume can grab by this way a firmware from this chip
[18:43:47] <hetii> never play with cypress, before ;)
[18:44:33] <hetii> in linuxtv.org there are planty of devices that use those component
[18:44:37] <hetii> in other configuration
[18:45:09] <hetii> I know that port B of cypress is used to control WJCE6353(demodulator)
[18:45:31] <hetii> I was able to play with this tuner as a logic analizer
[18:45:37] <hetii> by using sigrock
[19:13:32] <hetii> aandrew: is it possible to change somehow the usb vendor and device ids and try by that load other driver on this device in linux?
[19:14:41] <hetii> in this site: http://www.linuxtv.org/wiki/index.php/Geniatech there is one tunner called AME DTV-5100 and use CY7C68013A + WJCE6353
[19:14:50] <hetii> maybe this company don`t change much there :)
[19:37:32] <aandrew> sure, the firmware for usb-loaded FX2LP is really straightforward
[19:37:50] <ali1234> question would be better suited for #linuxtv
[19:37:51] <aandrew> the header gives you the VID/PID, you should find it within the first 16 bytes or so
[19:37:56] <aandrew> and yeah, ali1234's right
[19:37:59] <ali1234> but he left
[19:38:06] <aandrew> this really has nothing to do with AVR
[19:38:07] <aandrew> hm
[19:38:10] <aandrew> oh well :-)
[19:38:19] <ali1234> often you can just add the IDs to the kernel source and rebuild
[19:38:29] <ali1234> or you can insert them at runtime
[19:41:31] <Lambda_Aurigae> I believe there is a way in linux to assign vid/pid to a specific driver.
[19:46:29] <ali1234> yes, via the /sys bind interface
[19:46:57] <ali1234> http://unix.stackexchange.com/questions/12005/how-to-use-linux-kernel-driver-bind-unbind-interface-for-usb-hid-devices/13035#13035
[21:44:14] <rue_school> ooo didn't know that