#avr | Logs for 2012-06-13

Back
[01:13:21] <Xark> Hello. From my reading of the manual on ATmega328, if I am have enabled 2-wire serial interface, the value of bits 4 & 5 in PORTC will be ignored. Can anybody confirm this?
[01:14:56] <Xark> IOW can I write garbage to PORTC and not interfere with 2-wire serial interface?
[01:15:25] <Casper> when you enable any hardware stuff, it override the port
[01:15:46] <Casper> however, some hardware still allow to control DDR on some of the pins
[01:17:20] <Xark> Casper: Awesome, it sounded that way. However, e.g., on SPI the port still has some affect (changing pullup).
[01:18:20] <Xark> Casper: Thanks for the info. :)
[02:37:15] <iR0b0t1> Has anyone used the 32 bit AVRs?
[05:29:44] <OndraSter> hm
[05:29:46] <OndraSter> I am tempted to buy this
[05:29:47] <OndraSter> http://dx.com/p/16000w-energy-saving-device-white-ac-110-240v-french-plug-101007
[05:29:49] <OndraSter> and take it apart
[05:29:53] <OndraSter> I REALLY WONDER what is inside
[05:32:44] <karlp> magic, sweet and sacred air
[05:36:38] <mitsakos> hello, if you run the above define void (*app_start)(void) = 0x0000;
[05:36:56] <mitsakos> 0x000 is the start of the main() ?
[05:42:35] <OndraSter> no
[05:42:54] <OndraSter> it is the beginning of .init section (or whatever comes first)
[05:43:00] <OndraSter> that prepares the device for main()
[05:43:03] <mitsakos> so in a C program what is it?
[05:43:17] <OndraSter> something you can't see
[05:43:21] <OndraSter> it sets stack pointer
[05:43:30] <OndraSter> copies .data to RAM
[05:43:32] <OndraSter> etc
[05:43:43] <mitsakos> so it is like a software restart?
[05:43:51] <mitsakos> *reset
[05:43:57] <OndraSter> I suppose you saw that in a bootloader, no?
[05:44:20] <mitsakos> https://github.com/adafruit/Ice-Tube-Clock/blob/master/firmware/iv.c
[05:44:21] <mitsakos> here
[05:44:34] <mitsakos> she use it on the compare match interrupt
[05:45:20] <OndraSter> sorry gotta afk
[06:03:29] <mitsakos> well i have built an RTC and what i want to do is to make it sleep when power comes down and wakeup again the power is coming up. i have configured the comperator with internal bandgap ref voltage
[06:03:52] <mitsakos> ISR(ANALOG_COMP_vect){
[06:03:52] <mitsakos> if (ACSR & (1<<ACO)) {
[06:03:52] <mitsakos> sleep();
[06:03:53] <mitsakos> }else{
[06:03:53] <mitsakos> wakeup();
[06:03:53] <mitsakos> }
[06:03:55] <mitsakos> }
[06:04:04] <mitsakos> this is the analog comperator interrupt routine.
[06:04:31] <mitsakos> is it correct? sleep() and wakeup() turns all peripherals off and puts the mcu in Power Save Mode
[06:06:07] <specing> mitsakos: if (bit_is_set(ACSR, AC0)) ... <- more readable
[06:06:39] <specing> mitsakos: I'm not sure if using sleep in an ISR is wise
[06:06:52] <specing> Since interrupts are disabled in it
[06:07:13] <specing> that would effectively be "sleep until reset"
[06:07:55] <mitsakos> that is the problem i have :P
[06:07:58] <mitsakos> it never wakes up
[06:08:07] <specing> no wonder...
[06:08:33] <mitsakos> so what can i do? if add sei() in the ISR will it work?
[06:09:07] <specing> use BOD
[06:09:33] <mitsakos> what is this?
[06:10:54] <specing> FAILURE_TO_READ_DATASHEET_DETECTED
[06:12:04] <mitsakos> isn't there a way to wake it up with the comperator?
[06:14:28] <specing> mitsakos: datasheet....
[06:17:34] <mitsakos> The device can wake up from either timer overflow or output compare event from Timer/Counter2 if the corresponding Timer/Counter2 interrupt enable bits are set in TIMSK2,
[06:17:40] <mitsakos> so there isn't any other way?
[06:17:55] <mitsakos> this is for power save mode
[06:22:57] <specing> bod....
[06:24:59] <mitsakos> if timer2 wake up the mcu from power down mode. The mcu will run the ISR and then? what is following? sleep again? or run the next instruction from SLEEP
[06:28:59] <karlp> next from after sleep
[06:29:01] <karlp> it's woken up now.
[06:29:06] <karlp> unless you say go back to sleep
[06:30:06] <mitsakos> so if an interrupt occure from Timer2 the mcu will wake up and run the ISR of Timer2 right?
[06:30:15] <mitsakos> now
[06:30:38] <mitsakos> if the comperator is as low as when the comperator interrupt occured
[06:31:16] <mitsakos> will it occure again another interrupt if the comperator interrupt is configured Comparator interrupt on output toggle
[06:31:22] <mitsakos> no right?
[07:37:02] <JyZyXEL> http://www.indiamart.com/thinklabstechnosol/wireless-module.html
[07:37:18] <JyZyXEL> should i use some spesific I/O pin for that sort of stuff?
[07:38:24] <Tom_itx> http://www.rentron.com/PicBasic/RemoteControl.htm
[07:38:38] <Tom_itx> same stuff
[07:40:45] <JyZyXEL> im not sure the one i have has digital or linear output
[07:56:30] <PyroferUK> can somebody help with AVRdude please
[07:57:04] <specing> man?
[07:57:18] <JyZyXEL> http://winavr.scienceprog.com/example-avr-projects/running-tx433-and-rx433-rf-modules-with-avr-microcontrollers.html
[07:57:26] <PyroferUK> avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x0000 0xff != 0x07 avrdude: verification error; content mismatch avrdude: safemode: efuse changed! Was ff, and is now 7 Would you like this fuse to be changed back? [y/n] y
[07:57:33] <PyroferUK> now its just hung there :(
[07:57:38] <JyZyXEL> it uses RXD and standard serial stuff?
[07:57:42] <specing> PyroferUK: -B 10
[07:58:03] <specing> JyZyXEL: 404
[07:58:23] <JyZyXEL> not 404
[07:58:30] <specing> JyZyXEL: Ah, my client didn't pick up the .html part
[08:01:08] <JyZyXEL> And this is a part where you have many choices: use hardware encoding like USART or write your own based on one of many ending methods like NRZ, Manchester etc. In my example I have used AVR USART module to form data packs. Using hardware encoders solves many problems like synchronization, start and stop, various signal checks. But as long as I was practising you cannot rely on plain USART signal. Here you can
[08:01:10] <JyZyXEL> actually improvize by adding various checks and so on.
[08:01:17] <JyZyXEL> so you don't have to use USART?
[08:03:22] <specing> JyZyXEL: you can use whatever protocol suits you
[08:03:50] <PyroferUK> I get a mismatch error at byte 0x0000 0xff != 0x07 :(
[08:03:56] <specing> PyroferUK: -B 10
[08:03:59] <PyroferUK> is that normal?
[08:04:04] <PyroferUK> I did the -B 10
[08:04:06] <specing> No.
[08:04:12] <specing> Then try -B 100
[08:04:33] <PyroferUK> same error
[08:04:49] <PyroferUK> I get a mismatch on the chip type too and am doing -F
[08:05:13] <specing> then check the wires
[08:05:17] <PyroferUK> avrdude: Device signature = 0x1e9514 avrdude: Expected signature for ATMEGA328P is 1E 95 0F
[08:05:28] <specing> Also what programmer are you using?
[08:05:38] <PyroferUK> arduino as isp
[08:06:40] <JyZyXEL> so then hardware wise i don't need to hook up the receiver to a USART?
[08:06:46] <JyZyXEL> to a RXD
[08:08:26] <PyroferUK> not sure why my 328p gives a different checksum to what avrdude expects?
[08:09:48] <JyZyXEL> what do those 2272 or 2262 based remotes use?
[08:10:06] <JyZyXEL> because they use these RF modules in a really simple way
[08:12:16] <PyroferUK> ahh, google reveals its because its a PU not a p chip :(
[08:12:20] <JyZyXEL> i know there is a remote switch library for arduino that emulates them
[08:12:31] <PyroferUK> thanks for the help guys.
[08:16:41] <JyZyXEL> so if i wanna receive the PT2262 encoded signals what protocol should i use?
[08:16:58] <JyZyXEL> and what port/pin in the MCU for the data input
[08:20:08] <JyZyXEL> http://code.google.com/p/rc-switch/
[08:20:11] <JyZyXEL> thats the arduino version
[08:20:21] <JyZyXEL> anyone know avr-libc version?
[08:27:33] <JyZyXEL> ok so apparently any pin with a "external interrupt" will work
[08:31:48] <JyZyXEL> specing: so its a custom procotol i want?
[08:40:43] <specing> JyZyXEL: The tx/rx works bitwise as I understand it
[08:40:58] <specing> JyZyXEL: So it can transmit whatever protocol you want
[08:41:06] <JyZyXEL> im receiving
[08:41:24] <JyZyXEL> i have the transmitter already
[08:43:44] <JyZyXEL> its seems complicated even in the C++ code
[08:46:51] <JyZyXEL> maybe i should use the actual PT2272 receiver chip and hook it to the MCU
[08:48:30] <JyZyXEL> i don't know if it can be set to receive everything though
[08:49:32] <JyZyXEL> probably not
[08:49:39] <JyZyXEL> the documentation is absolute shit
[08:56:28] <JyZyXEL> its strongly pushing toward buying an arduino just so i can use the already made decoder code
[08:56:37] <JyZyXEL> and hook the arduino to my AVR with something
[09:38:36] <specing> LOL
[10:27:20] <Tom_itx> http://www2.electronicproducts.com/How_to_securely_transfer_data_through_your_body-article-fajb_bioacoustic_data_transfer_jun2012-html.aspx
[11:25:11] <spybert> heh
[23:37:16] <ferdna> "asshole from Freenode" I just approved your comment. thank you =)