#avr | Logs for 2016-12-24

Back
[03:55:49] <rue_bed> Lambda-Aurigae, you get a programmer too?
[05:02:28] <Lambda-Aurigae> rue_bed, yea...an stlink for stm8 and stm32
[06:32:58] <noqnio1> hey. I am using adc on a mega48pa, and if i try to use other portc pins as output, i get a constant voltage of 4.2v
[06:43:03] <cehteh> noqnio1: something wrong configured, pullups etc
[06:43:18] <cehteh> and/or excessive noise or so
[06:43:31] <noqnio1> port c needs pull ups ?
[06:43:48] <cehteh> no i meant did you enable the internal pullups?
[06:44:11] <noqnio1> by DDR?
[06:44:30] <cehteh> i havent used the 48pa, but i dont expect them to be *that* different to other avrs, the error should be rather on your side
[06:44:54] <cehteh> how is the chip connected?
[06:45:05] <cehteh> all VCC's and GND's connected?
[06:45:17] <cehteh> AVCC connecte, preferably over a filter?
[06:45:52] <noqnio1> yeah
[06:45:55] <cehteh> what do you use as reference voltage?
[06:45:56] <cehteh> etc
[06:46:06] <cehteh> just double check everything
[06:46:11] <noqnio1> DDRC = 1 << PC1;
[06:46:11] <noqnio1> DDRC = 1 << PC2;
[06:46:18] <noqnio1> PORTC |= (1 << PC1);
[06:46:18] <noqnio1> delnms(100);
[06:46:18] <noqnio1> PORTC |= (0 << PC1);
[06:46:23] <noqnio1> and nothing happens
[06:46:27] <cehteh> dont paste code here, use a pastebin
[06:47:26] <cehteh> that DDRC needs |= as well and 0 << gives nothing
[06:48:00] <noqnio1> oh i need ~
[06:48:03] <noqnio1> srry right
[09:45:26] <Lambda-Aurigae> https://hackaday.com/2016/12/24/instant-camera-with-this-years-hottest-dithering-technique/
[09:45:34] <Lambda-Aurigae> the first actual project I've ever seen done with Ada.
[09:53:15] <noqnio1> he is one of the ada developers
[09:54:30] <specing> ^ few
[12:52:42] <rue_house> ugh
[12:54:26] <rue_house> #define SetBit(BIT, PORT) (PORT |= (1<<BIT))
[12:54:26] <rue_house> #define ClearBit(BIT, PORT) (PORT &= ~(1<<BIT))
[12:54:26] <rue_house> #define IsHigh(BIT, PORT) (PORT & (1<<BIT)) != 0
[12:54:26] <rue_house> #define IsLow(BIT, PORT) (PORT & (1<<BIT)) == 0
[12:54:26] <rue_house> #define NOP() asm volatile ("nop"::)
[12:54:59] <rue_house> ^^^ you people can use those
[13:06:43] <antto> deep house, tech house, rue house
[16:50:03] <toddpratt> why is avr-gcc adding -lm and -lc to the linking phase? How do I stop that?
[17:37:07] <twnqx> i should never add -lm by default
[17:37:37] <twnqx> it*
[19:31:16] <rue_shop3> antto, ...?
[19:35:07] <antto> just house then
[20:31:49] <_JC> hello
[22:01:22] <Emil> rue_shop3: do those really work?
[22:01:28] <Emil> rue_house: ?
[22:01:48] <Emil> ah
[22:01:50] <Emil> they are defines
[22:03:01] <Emil> So yes the do
[22:24:08] <rue_shop3> #define clockPort PORTB
[22:24:14] <rue_shop3> #define clockBit 4
[22:24:42] <rue_shop3> #define SetClock() SetBit(clockBit, clockPort)
[22:24:57] <rue_shop3> if (!time) SetClock();
[22:25:18] <rue_shop3> #define ClearClock() ClearBit(clockBit, clockPort)
[22:25:38] <rue_shop3> #define PulseClock() SetClock(); NOP(); ClearClock()
[22:26:18] <rue_shop3> for(i = 0; i <8; i++) {PulseClock();} // <<-- BE REALLY CAREFULL TO REMEMBER THE BRACES!!!!!