#avr Logs

Apr 18 2019

#avr Calendar

12:29 AM rue_mohr: --
12:34 AM Thrashbarg: yup
01:26 AM gsi__ is now known as gsi_
04:08 AM paulo_ is now known as Guest29083
10:16 AM naftilos76: Hi everyone, i want to connect an AVR possibly mega168 via spi to a variable gain opamp which however uses a common pin for data I/O. Can avrs communicate in this mode?
10:18 AM LeoNerd: What happens if you just tie MISO & MOSI to it?
10:18 AM LeoNerd: Presumably the chip goes into hiZ mode on receive and only drives it when it transmits? A sortof half-duplex SPI?
10:18 AM LeoNerd: Perhaps use a resistor on the MO line in case of drive contention, but then clear the relevant DDRx bit when you're receiving
10:22 AM naftilos76: LeoNerd: i thought about it and yes you are right that it could work if i use s/w and a bit of h/w tweeking to do the trick... Thanks
10:24 AM polprog: what chip is that?
10:24 AM polprog: the datasheet should explain it
10:24 AM polprog: and common pin like that on SPI is very common, its like half-duplex spi
02:55 PM guanche: I'm using timer1 in ctc mode configured for 1Mhz, and I can see it working. But as soon as I disable hardware pin-toggling, and set up TIMER1_COMPA_vect (with nothing else inside than PORTX ^= (1 << PORT_PIN)) the output frequency falls to ~210Khz, is this the normal/expected thing?
02:56 PM guanche: I am doing this with a pro-micro (32u4 with usb enabled, but iddle)
02:57 PM LeoNerd: Mmmmm micro
02:57 PM guanche: but I do remember having done some complex timming stuff with 168 back at the time, same way, using compare vector, and never noticing this
03:01 PM guanche: I guess it might be due to usb having higher prority than the timer, because no way I've tried it works
03:12 PM cehteh: note that you can toggle pins in hardeware with newer AVR's PINX |= (1 << PORT_PIN)
03:14 PM LeoNerd: You can toggle pins on the -really- newer AVRs with PORTA.OUTTGL = (1 << pin);
03:14 PM LeoNerd: ;)
03:22 PM guanche: that's not toggling, that's taking it high cehteh
03:22 PM LeoNerd: guanche: If you write to the PIN register (not the PORT) on some of the chips, it toggles
03:23 PM guanche: oh really?
03:23 PM LeoNerd: The newer "xtiny" chips have a dedicated toggle register
03:23 PM cehteh: yesa
03:23 PM cehteh: not all chips have that but many newer ones and iirc all atmegas, but check datasheeet
03:23 PM guanche: well, I'm not too on the newer stuff, so it's normal I didn't know
03:23 PM guanche: I'm really hating the 32u4 though
03:24 PM cehteh: i mean newer as in "10 years" :)
03:24 PM guanche: yeah, hehe
03:24 PM cehteh: lol dunno when it appeared but quite some time ago
11:15 PM day_ is now known as day
11:55 PM rue_mohr: the new new is the old
11:55 PM rue_mohr: 8051 is back, are YOU ready?