#avr | Logs for 2016-10-23

Back
[07:26:56] <specing> Does anyone know of any open hardware 220AC 3-phase motor inverter boards (VFD)?
[08:02:03] <Lambda_Aurigae> specing, not I
[08:11:36] <specing> :/
[14:21:27] <specing> Uh
[14:21:39] <specing> Why are there so few triac boards on ebay?
[14:21:50] <specing> there are only aptinex modules sold by aptinex
[14:23:09] <specing> like ... 2 of them
[14:24:03] <theBear> cos you don't nee da board for one or two componetns ?
[14:24:55] <specing> by that logic you dont need a board for a relay either
[14:25:03] <specing> but there are like 3000+ relay boards on ebay
[14:25:56] <specing> not to mention the added value of no 220AC on my solderless breadboard
[14:26:33] <theBear> fair duece
[14:26:38] <theBear> deuce ? hmm
[14:27:07] <specing> also I'm no EE so I don't want to touch 220AC circuits at this point
[14:27:28] <theBear> you should see the thing i rigged up when i retrofitted the led psu into my projector, my god it's questionable, and it switching pre-filtered 350vdc that used to feed the ballast :) but yeah, i don't advocate it
[14:27:51] <theBear> howbout i change my original answer to "cos ssr's are all that in a neat package" ? i just thought it up
[14:29:19] <specing> ssrs automatically turn off when ac crosses 0?
[14:30:35] <Tom_L> what do you need a triac for?
[14:31:29] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/toaster_oven/control_sch.png
[14:31:31] <specing> not much on ebay either
[14:31:43] <Tom_L> to the right above the title block is the triac circuit for my toaster oven
[14:31:47] <specing> to control small loads
[14:31:58] <specing> like lights and solenoids and stuff
[14:32:04] <Tom_L> ^^ will do
[14:32:15] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/toaster_oven/blinktest2.jpg
[14:32:26] <specing> http://www.ebay.com/itm/APTINEX-4-Channel-Triac-Module-MOC3061-BT139-600V-16A-/181919113253?hash=item2a5b396025:g:Fg0AAOSwA3tXop1e
[14:32:57] <Tom_L> not sure why they need 4 triacs on that
[14:33:19] <specing> so you can control 4 things from the same board?
[14:33:26] <Tom_L> maybe
[14:33:30] <specing> and technically there are 8 triacs on there
[14:33:34] <specing> and 2 on your schematics
[14:33:40] <Tom_L> true
[14:33:57] <Tom_L> i didn't count the opto
[14:34:09] <Tom_L> but you can get a zero crossing opto just for that shutoff thing
[14:35:11] <Tom_L> http://www.digikey.com/product-detail/en/lite-on-inc/MOC3063/160-1722-5-ND/670014
[14:36:05] <theBear> got a broken aircon ? compressor or evap based portables and many splits got a board like that 4 channel thing maybe with a micro if they a small portable
[14:36:37] <theBear> also just a bare moc30?1/2/3 can switch an amp or more mains without a bigger triac hanging off it
[14:36:41] <Tom_L> hah they used the same opto
[14:37:15] <Tom_L> seems fine to me
[14:37:39] <Tom_L> except you may want a heatsink
[14:38:00] <Tom_L> and i don't remember if the tabs are isolated
[14:38:48] <specing> everything I'm planning to switch is <1A
[14:39:01] <specing> 220V 1A is 220W
[14:39:01] <Tom_L> should be fine then
[14:39:07] <specing> thats a lot
[14:39:26] <Tom_L> i used it on my toaster elements 2 ea
[14:39:41] <Tom_L> 4 in all
[14:40:25] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/toaster_oven/control_mounted2.jpg
[14:40:41] <Tom_L> i would have used one but i had those triacs
[14:41:52] <specing> why did you use a triac for what I presume is a heater
[14:41:59] <specing> and not an ordinary relay?
[14:42:45] <Tom_L> a relay would likely work fine too
[15:16:25] <specing> Tom_L: X1-1 X1-2... did you use two terminal block holes per trace?
[15:17:01] <specing> what are the resistor+capacitor for on the far right?
[15:41:12] <specing> LOL I just noticed
[15:41:32] <specing> the aptinex 2 channel module offer has schematics for the 4-channel one
[15:41:41] <specing> while the 4 channel one has schematics for the 2 channel one
[16:57:21] <Krampus> Anyone know if the USI block (like in a Tiny) has a dependency on Timer0? I'm using Timer1 to hit the USICLK toggle, but I never get the overflow interrupt. Timer0 is disabled.
[16:57:23] <jaggz> what are my options for my atmega32u4 (or other variations) being a USB mouse?
[16:57:59] <jaggz> I did a project with LUFA but there are problems with windows recognizing it (I have to set the com port settings each time I connect it)
[16:58:28] <Casper> use a better lufa project?
[16:58:42] <jaggz> thre's more than one lufa?
[16:59:11] <Casper> no, but the way the mouse was implemented may be an issue
[16:59:28] <Casper> usb mouse do not have com port setting, in fact, it do not have com port
[16:59:58] <Casper> so it look like you implemented a usb-serial and a serial mouse
[17:01:02] <jaggz> Casper, http://paste.debian.net/889109/
[17:01:30] <Casper> never touched lufa
[17:02:09] <jaggz> 122 CDC_Device_CreateStream(&VirtualSerial_CDC_Interface, &USBSerialStream);
[17:03:07] <Casper> virtualserial... seems to be the issue
[17:04:00] <jaggz> I don't even see the mouse code there..
[17:05:53] <jaggz> Casper, oh.. it was because I didn't get to the mouse point yet
[17:06:03] <jaggz> was just using the serial for debugging
[17:06:10] <Casper> but iirc, CDC is usb-serial too..
[17:06:38] <jaggz> so.. my plain serial isn't working
[17:06:48] <jaggz> been a while since I touched this.. probably in w10 it works ;)
[17:09:22] <LeoNerd> USB mouse is a form of HID; you want to be looking for HID in the code
[17:09:54] <Casper> Human Input Device
[17:12:06] <jaggz> ok.. will get to the hid part later.. main thing then was the com port not getting its baud, parity, etc. set
[17:12:31] <jaggz> I can return to the whole thing later .. mentally tired for some reason
[17:14:20] <jaggz> why's leonerd suddenly all over?
[17:14:31] <jaggz> #electronics, here, who knows where else
[17:14:32] <jaggz> :)
[17:17:26] <twnqx> LeoNerd is here for eternities
[17:17:37] <jaggz> :)
[17:17:53] <LeoNerd> jaggz: I get everywhere :)
[17:18:15] <jaggz> :)
[19:34:22] <hetii> Hello :)
[19:34:53] <Lambda_Aurigae> olleH
[19:42:24] <hetii> hmm I wonder about something, is it possible to use two lockup table, one for pointers to bits in register and second to values that represent sequence that need to be set in that register ?
[19:45:17] <Lambda_Aurigae> probably
[19:46:12] <hetii> hmm
[19:54:29] <Casper> hetii: do you have enought flash and/or ram for those 2 tables?
[19:55:15] <hetii> yes
[20:00:11] <Casper> then why can't you use two different tables?
[20:04:07] <hetii> Casper: my plan was to use two tables, but now I think about some struct where each bit will be mapped somehow to other bits in someregister
[20:05:45] <hetii> Casper: for ex avr have a PORTB and PORTC and my plan is to create a FOOD structure with pointers to some pins from PORTB and PORTC
[20:14:13] <cehteh> what is a FOOD structure?
[20:15:09] <Lambda_Aurigae> fix or obscure daily
[20:15:24] <cehteh> heh
[20:19:17] <hetii> cehteh: structure with pin pointers
[20:19:50] <cehteh> pins are not addressible :D
[20:19:57] <cehteh> (aka bits)
[20:21:02] <cehteh> do you want some relation? if pin 2 on PORTB is set then link that to bit 5 of PORTC for example?
[20:21:46] <hetii> cehteh: something similar to http://pastebin.ca/3732150
[20:23:23] <cehteh> be careful ordering in bitfields is implementation defined (well not a big probem, but just to know)
[20:23:53] <cehteh> but why do you want to do it this way?
[20:24:29] <hetii> ok general the problem that I have to solve is that I have some IC that use 8bit bus (it is two stepper drivers) and to drive full cycle I need send in sequence 33 different states
[20:25:14] <cehteh> the usually 1<<n or _BV() should be fine?
[20:25:46] <cehteh> 0b00000000 notation?
[20:26:10] <hetii> yep that work if each pin of this bus belong to single port
[20:26:35] <hetii> but things complicate if they are wired to different one
[20:26:52] <cehteh> uint8_t states[33] = { 0b11000000, 0b01100000, ... etc ?
[20:27:17] <cehteh> ah
[20:27:40] <cehteh> i'd try to solve that with the preprocessor, bit messy too, but works for sure
[20:27:46] <hetii> cehteh: yep I build such states lookup table: http://pastebin.ca/3732153
[20:28:59] <cehteh> define all phases, define all output relations and then stitch it together
[20:29:00] <hetii> but again its just states, the tricky things is to get it and assinge to proper pin in each port
[20:29:07] <cehteh> yes
[20:30:42] <cehteh> #define PHASEA (port,pin) for example #define PHASEA (B,4) .... and so on
[20:31:30] <cehteh> well the implementation getting messy, but you can configure it easily
[20:33:25] <cehteh> imagine then a STATE(PHASEA, D2A, D1A ,D0A, PHASEB, D2B, D1B, D0B) .. thats the phases from your table
[20:34:26] <hetii> I also consider to maybe use two dimension array, like {{1,1,1,1,0,0,0,1},{1,1,1,1,0,0,0,0},} and then iterate over it and assinge in loop each bit to final port
[20:34:42] <cehteh> #define STATES STATE( X, L, L, L,X, L, L, L) STATE(.....)
[20:34:58] <cehteh> thats wasteful :)
[20:35:17] <cehteh> and fiddeling out the bits and calculating the masks takes time
[20:35:40] <cehteh> i'd just generate one simple 33 bytes table at compiletime
[20:35:43] <hetii> yep, true
[20:36:20] <cehteh> preprocessor metaprogramming ftw
[20:37:06] <cehteh> mmh 66 bytes table when you need 2 ports
[20:37:49] <cehteh> but 1 port might be better because you can set all outputs in one instruction
[20:38:53] <cehteh> what does X in your table mean? undefined? arbitary? unchanged?
[20:39:26] <hetii> undefined I guess
[20:39:41] <cehteh> guess? :)
[20:40:35] <hetii> Datasheet of this IC goo.gl/qb69L5
[20:40:54] <hetii> General this state should be ignored when all D lines are low
[20:40:57] <cehteh> Discontinued Product
[20:42:00] <hetii> Now probably the replacement is A4975
[20:42:34] <cehteh> anyway, do you get my idea about creating the table with the preprocessor?
[20:43:11] <cehteh> its a little work to figure out, but generates the best code, everything is resovled at compiletime
[20:44:14] <hetii> more or less
[20:45:01] <cehteh> eh do you even need a table? as i see its just arithmetic counting and negation
[20:45:50] <cehteh> (still table might be the simplest/fastest way)
[20:45:58] <hetii> well I grab a part of PCB board from old plotter where have this stepper drivers and they are drive by two STC11F01 IC, so the final driver need to be able to be compiled by sdcc
[20:46:23] <hetii> but need to check what is possible in that area
[20:47:34] <hetii> currently when I try to use #define REGISTER_BIT(rg,bt) ((volatile _io_reg*)&rg)->bit##bt I get
[20:47:36] <hetii> a3955.h:73: syntax error: token -> 'volatile' ; column 10
[20:47:40] <hetii> from sdcc
[20:52:14] <cehteh> i never really worked with sdcc
[20:52:30] <hetii> cehteh: well me too :)
[20:52:43] <cehteh> but i'd try a less hackish approach, with more std conforming code
[20:53:00] <cehteh> like i saied, bitfield ordering isnt really defined
[20:53:39] <cehteh> and ideally you want your state table in a way that you can poke the values directly into the ports
[20:55:12] <cehteh> what kind of chip is this STC?
[20:55:52] <hetii> something that should be compatible with MCS51
[20:56:02] <cehteh> 8051?
[20:56:15] <cehteh> 8 bit, 16bit? .. what arch?
[20:56:31] <cehteh> (trying to download a datasheet .. sloooooow)
[20:56:44] <hetii> STC11/10xx series are a single-chip microcontroller based on a high performance 1T architecture 80C51 CPU,
[20:56:44] <hetii> which is produced by STC MCU Limited.
[20:56:44] <cehteh> prolly scanned chinese :D
[20:56:54] <cehteh> ohnoooo
[20:56:59] <cehteh> 8051 :)
[20:57:17] <cehteh> they never die
[20:58:25] <hetii> Well I`m not even sure If be able to reprogram it, I found some project called stcgal who should do it for me
[20:58:30] <cehteh> https://en.wikipedia.org/wiki/Intel_MCS-51
[20:58:36] <hetii> but didint test it
[20:58:51] <cehteh> can you just throw it out and replace it with an AVR? :D
[21:00:13] <cehteh> i dont even know how these are flashed, some are ROM / mask programmed .. all are PITA
[21:00:50] <hetii> well this was my first idea, to get just those A3955 driver, make new pcb and add some AVR with GRBL project
[21:01:55] <hetii> so this is my backup plan if I don`t run those STC ICs
[21:03:55] <hetii> Also when I decide to use avr to control them, for 3 axes I need then to use 2 avr, (one for GRBL) and second to driver them.
[21:04:14] <cehteh> why that? just use a bigger avr?
[21:04:57] <hetii> yep, also possible but then need to change grbl to handle such bigger avr
[21:05:18] <cehteh> ah yes
[21:06:01] <cehteh> sounds like some work
[21:07:51] <hetii> yep, reconfigure all timers/register and the way how author of grbl driver 3 steppers
[21:08:10] <hetii> so not an easy task at the beginning :)
[21:12:35] <hetii> cehteh: ok time to sleep, thx for all tips and have a nice day/night :)
[21:13:00] <cehteh> n8
[22:32:34] <crazy_pete> anyone have a good idea for a drafting tool (not an analyser like spice) for linux for laying out PCB? I just need a drafting tool like dia, but dia's electronic icons aren't quite to spec. Or does anyone have some nice dia objects? :-)
[22:34:06] <crazy_pete> (dia is actually what i want, just the circuit shape repository that comes with it isn't very good)
[22:34:25] <crazy_pete> oh sorry i am in the AVR not the electronics channel
[22:34:43] <crazy_pete> well i was ACTUALLY planning to do this with an AVR design, i swear! :-)
[22:49:00] <cehteh> crazy_pete: kicad
[22:49:33] <Casper> eagle
[22:49:58] <crazy_pete> thanks cehteh
[22:50:04] <crazy_pete> i am downloading it now
[22:50:06] <crazy_pete> great clue
[22:56:00] <cehteh> the free version of eagle sux :D
[23:00:39] <Casper> it used to be good
[23:00:44] <Casper> the 4.19 version
[23:01:11] <Casper> then I think they triggered a timebomb, and you had to run the newer version, which had more restrictions