#avr | Logs for 2016-12-04

Back
[00:51:59] <Casper> ferdna: ?
[01:06:59] <ferdna> Casper, hello! =)
[05:06:31] <humunuk> hi, does #define CONST_NAME "Some value" is written to program space?
[05:12:30] <specing> humunuk: depends on how it is used inside your code.
[05:12:45] <humunuk> hmm
[05:13:28] <humunuk> so if i do #define CONST_NAME "Some value" and fprintf_P(stdout, PSTR(CONST_NAME), "\n");
[05:13:35] <humunuk> it will write it to program space?
[05:13:41] <humunuk> and read it from there
[05:14:57] <humunuk> otherwise i dont really understand because PSTR says: "Used to declare a static pointer to a string in program space."
[05:16:44] <Thrashbarg> humunuk: are you familiar with the C preprocessor?
[05:17:10] <humunuk> if u ask that question i should go read my materials again :)
[05:17:19] <Thrashbarg> perhaps
[05:17:45] <Thrashbarg> what I mean is #define MACRO constant will replace every instance of MACRO with constant before the program is compiled
[05:18:42] <Thrashbarg> so #define print fprintf_P could be declared, and you could just go print(stdout, "Hello world");
[05:19:21] <Thrashbarg> because print is repalced with fprintf_P
[05:19:37] <specing> humunuk: in the end you can always look at the resulting .elf
[05:19:40] <specing> and disassembly
[05:20:35] <humunuk> ah
[05:20:36] <humunuk> okay
[05:22:35] <Thrashbarg> humunuk: PSTR(CONST_NAME) would be expanded by the CPP to PSTR("Some value") in your example before the code is compiled.
[05:22:57] <humunuk> yeah
[05:23:02] <humunuk> that i understood
[05:23:08] <humunuk> after your explanation
[05:23:10] <Thrashbarg> good :P
[05:24:05] <Thrashbarg> also means if you use that macro a few times it'd be creating separate identical strings in program space
[05:24:12] <Thrashbarg> which would be wasteful
[05:24:48] <humunuk> yeah
[05:25:43] <humunuk> then im kind of okay, my lecturer asks me to first put every string literal into #define in a header file and then he asks me to put all string literals into program space
[05:25:51] <humunuk> so it didnt make any sense
[05:26:23] <Thrashbarg> sounds it
[05:27:09] <humunuk> so my first plan was to actually declare strings in header file which are put into program space with PROGMEM macro and then read them out from there, thats correct thing?
[05:27:32] <Thrashbarg> that would make much more sense
[05:27:34] <humunuk> if we talk about using less space and not creating multiple strings
[05:29:40] <Thrashbarg> if you're going to use the same string more than once you can go ... const PROGMEM char * string = "Hello World"; ... which creates a string but gives you the pointer to it in 'string'. Then you just fprintf_P(stdout, string); whenever you want to print that string
[05:30:01] <Thrashbarg> (pretty sure that's correct?)
[05:31:42] <humunuk> mm
[05:31:58] <humunuk> the PROGMEM word is in wrong place i think but in general yes?
[05:32:01] <humunuk> ill test and see :)
[05:32:04] <humunuk> thanks for the help
[05:32:07] <Thrashbarg> no problem
[05:40:04] <deepbluv> hi,can AT90s1299 bear the minimalist code od a 4-bit digital clock?
[05:47:16] <Guest8899> can an AT90s1200 bear the minimalist bare-bone code of 4-digit digital clock ?
[05:47:32] <specing> ?_?
[05:47:54] <Guest8899> it's got 1 kbyte of isp flash
[05:50:54] <specing> Guest8899: do you know why devkits feature the biggest chip of the family?
[05:52:53] <Guest8899> specing: no,why?
[05:54:50] <Guest8899> specing: i 'm considering to buy 10 AT90s1200 to sell as 4-bit digital clock to minimize cost
[05:55:17] <specing> Well, try and answer that question and you'll find an answer to yours as well
[05:55:55] <Guest8899> specing: i 'm considering to buy 10 AT90s1200 to sell as 4-bit digital clocks to minimize cost
[05:57:46] <Guest8899> specing: please tell me the answer
[05:57:50] <twnqx> if you need 1kB for that you are doing something wrong
[05:58:26] <Guest8899> twnqx: so how much dose it take minimal?
[05:58:46] <Guest8899> does*
[05:58:50] <twnqx> no idea until i write it
[05:59:02] <specing> Guest8899: no
[05:59:24] <twnqx> but i'd say it's like 20 lines of C plus a lut
[06:00:12] <Guest8899> twnqx: doesn't seem much,right?
[06:00:16] <twnqx> no
[06:00:52] <twnqx> but much depends on how you drive the clock display
[06:01:20] <Guest8899> twnqx: so you recommend the deal ?
[06:01:34] <twnqx> i would not recommend any at90, they seem obsolete to me
[06:02:13] <Guest8899> twnqx: i want to use a 7-segment LED diaplay
[06:02:42] <Guest8899> twnqx: AT90 will minimize cost
[06:04:57] <Guest8899> twnqx: ?
[06:05:37] <Guest8899> i just wanna make sure it's enough for the job
[06:05:58] <twnqx> my guess is "yes"
[06:06:09] <Guest8899> twnqx: ok,thanx a lot
[06:06:23] <twnqx> but i did not check the pins etc
[06:06:28] <twnqx> just the code space
[06:06:49] <Guest8899> twnqx: it's got 15 i/o pins
[06:07:48] <Guest8899> so..?
[06:09:07] <Guest8899> i think if some sort of programmed multiplexing
[06:09:25] <Guest8899> will fix it
[06:09:38] <twnqx> probably
[06:10:51] <Guest8899> twnqx: ok,I trust your judgement.thanx ,bro
[08:58:00] <_ami_> twnqx: yo
[08:58:16] <_ami_> twnqx: wrote linux framebuffer driver before?
[08:59:09] <_ami_> i am trying to write one driver for my 3.5 inch tft display. it has 8 bit parallel data transfer interface.
[09:00:23] <specing> fun
[09:02:05] <twnqx> nah
[09:03:06] <aczid> I remember playing with one of those
[09:03:19] <aczid> I remember getting mplayer and terminal apps working, but never a full display
[09:03:20] <aczid> http://picframe.spritesserver.nl/wiki/index.php/Main_Page
[09:03:23] <aczid> maybe this helps
[09:17:47] <vectory> and then you rendered the display as mp4 stream? :)
[09:23:44] <Emil> Anyone dabbled with the nrf24l01+ before? Writing their own driver?
[09:26:11] <Emil> I'm somewhat confused by the data pipes thing
[09:43:43] <_ami_> aczid: used fbtft driver for it? or wrote your alone driver?
[09:44:00] <aczid> I didn't write a driver, it was all in userland
[09:44:10] <_ami_> aczid: aha, ok
[09:46:14] <_ami_> aczid: i am able to communicate with display via mega2560. also able to write spi driver which clears the screen and draw a rect. https://github.com/amitesh-singh/ldd/blob/master/spi/st7735_rect/spi.c
[09:46:29] <_ami_> its just fb driver sdk of linux kernel looks confusing.
[09:47:04] <_ami_> will try it again. i tried for st7735 first. when i get success, it would be easier to write code for 3.5" display.
[09:47:35] <aczid> aah you are using an avr :) I thought you just had one of those digital photoframe usb thingies like I used :)
[09:49:00] <_ami_> aczid: i used with avr as a proof of concept first. it works.
[09:49:12] <_ami_> the code which is posted is linux driver for raspberry pi2.
[09:49:55] <_ami_> there is not much guide available on how to write frame driver.
[09:54:40] <_ami_> btw, there are so many tiny spi displays available in market.
[09:55:40] <_ami_> if we make a usb to spi module which is specific to connecting these displays to any PC. (which does not need to have gpios). will people buy?
[09:56:09] <_ami_> a linux driver needs to be provided for sure.
[09:58:56] <aczid> you'd think something like that would be out there
[09:59:05] <aczid> rpi community seems like the best resource for that
[09:59:32] <Lambda_Aurigae> the protocols for all of them similar?
[09:59:49] <_ami_> Lambda_Aurigae: the linux driver will take care of it.
[09:59:51] <Lambda_Aurigae> a simple usart-spi interface should be easily doable....in fact, has been done.
[10:00:03] <Lambda_Aurigae> or usb-cdc-spi interface.
[10:00:24] <Lambda_Aurigae> buspirate gives you usb-spi interface already..and it sells.
[10:02:00] <_ami_> http://www.mouser.in/new/microchip/microchipmcp2210/
[10:02:12] <_ami_> Lambda_Aurigae: yeah, its there.
[10:03:54] <Lambda_Aurigae> _ami_, a pic16f1454 is about half the price...has all the same functionality but you have to program it...
[10:04:07] <Lambda_Aurigae> the mcp22xx chips are just pic16 chips hard coded.
[10:05:55] <Lambda_Aurigae> sorry...18f
[10:06:15] <Lambda_Aurigae> pic18f14k50 for the mcp2200
[10:06:30] <Lambda_Aurigae> I would be the mcp2210 is the same chip with slightly different code.
[10:07:15] <Lambda_Aurigae> hmm
[10:07:28] <Lambda_Aurigae> the 14k50 is more expensive...but it's still the same chips as the 2200.
[10:07:56] <Lambda_Aurigae> one could do the same with a pic16f1454 though....hardware usb with no external crystal requirement even.
[10:09:40] <_ami_> Lambda_Aurigae: noted down, thanks.
[10:11:16] <Lambda_Aurigae> one could do similar with one of the usb avr chips as well.
[10:11:27] <Lambda_Aurigae> or, with v-usb and just about any avr.
[10:12:12] <Lambda_Aurigae> v-usb is considered a commercial level software these days and only compatible with about 70% of the pc side usb hardware I have these days.
[10:12:26] <_ami_> Lambda_Aurigae: doing that with vusb would be a cheaper option for Proof of concept. but is n't vusb too slow? :)
[10:12:52] <Lambda_Aurigae> all depends on how fast you need it to be.
[10:13:13] <Lambda_Aurigae> I wouldn't use v-usb for anything I wanted to stake my career on.
[10:13:23] <Lambda_Aurigae> it is low speed usb, however.
[10:13:46] <Lambda_Aurigae> I use various usb pic chips for different usb interfaces these days.
[10:13:58] <Lambda_Aurigae> mostly because I can get them in dip package for ease of use
[10:14:12] <specing> > stake my career on
[10:14:25] <specing> oh come on, its not like the market isn't full of barely working products
[10:14:27] <Lambda_Aurigae> I used to use cypress chips but can't get them in dip package.
[10:14:37] <Lambda_Aurigae> specing, yeah,,,,usbasp for the,,,umm,,something
[10:14:38] <specing> even from established western engineering companies
[10:15:01] <specing> these days I just buy chinese designed products
[10:15:14] <specing> because they are better and much cheaper than western ones
[10:15:36] <_ami_> Lambda_Aurigae: usbasp is pretty cheap. we can consider that this is also one of reason for avr to become popular?
[10:15:41] <Lambda_Aurigae> will give you the cheaper part...better,,,,some yes some no...
[10:16:07] <Lambda_Aurigae> _ami_, avr was becoming popular before usbasp and arduino.
[10:16:26] <_ami_> Lambda_Aurigae: aha, ok.
[10:16:31] <Lambda_Aurigae> with the open source software for avr, it blossomed
[10:16:47] <Lambda_Aurigae> and the fact that I could make a programmer with 4 wires stuffed into my parallel port, it was easier to program than pic.
[10:16:49] <specing> AVR just needs a cheap debugger
[10:17:03] <Lambda_Aurigae> pic chips required a lot more in the way of programmer hardware back 15 years ago than avr did.
[10:17:03] <specing> something to rival $10 stm devkits
[10:17:13] <_ami_> Lambda_Aurigae: i like to try PIC but its too costly to try. the pic programmer is like 30-40$
[10:17:25] <specing> don't try PIC
[10:17:29] <specing> its awful
[10:17:33] <specing> wasteoflife/10
[10:17:41] <Lambda_Aurigae> specing, some are, some aren't...the pic32 chips rock.
[10:17:46] <_ami_> specing: yeah, :)
[10:17:53] <Lambda_Aurigae> pic16 and pic18 are,,,meh...
[10:17:55] <specing> we are talking about PIC, not MIPS "PIC" lines
[10:17:59] <Lambda_Aurigae> except for having usb in a dip package.
[10:18:19] <Lambda_Aurigae> I got a pickit3 on sale for under $20.00 USD
[10:18:40] <specing> well you can get a stm32 board with debugger for like $7
[10:18:52] <Lambda_Aurigae> and have to learn yet another platform!
[10:18:57] <specing> easy
[10:19:02] <_ami_> specing: plz do let me know when you know of cheaper option of avr debugger.
[10:19:04] <specing> don't learn PIC in the first place
[10:19:15] <specing> _ami_: dump avr, go stm31
[10:19:19] <_ami_> stm32 is nice..
[10:19:20] <specing> stm32*
[10:19:38] <_ami_> i need to buy one.. gonna place a order @ aliexpress. ;)
[10:19:45] <specing> :)
[10:19:52] <specing> get a discovery kit
[10:20:43] <_ami_> specing: i got it locally on amazon IN. http://www.amazon.in/STM32F103C8T6-Minimum-System-Development-Arduino/dp/B01EM11KOC/ref=sr_1_1?ie=UTF8&qid=1480866683&sr=8-1&keywords=STM32
[10:20:49] <_ami_> and
[10:20:50] <_ami_> http://www.amazon.in/ST-Link-Programming-Metal-Emulator-Downloader/dp/B01EM10DPO/ref=sr_1_2?ie=UTF8&qid=1480866683&sr=8-2&keywords=STM32
[10:21:13] <_ami_> cheaper for me and probably ship FASTER
[10:22:11] <_ami_> total ~12$ .
[10:22:47] <specing> no farnell?
[10:22:56] <specing> but ok
[10:23:04] <specing> whatever is better for you
[10:24:02] <_ami_> specing: is STM32F103C8T6 good?
[10:25:53] <_ami_> specing: probably did you mean this? http://www.ebay.in/itm/STM32F0-DISCOVERY-Cortex-M0-STM32-Development-Board-/262635487500?hash=item3d264b810c:g:GSMAAOSwPCVX4iW7
[10:26:07] <specing> why would it be bad?
[10:27:16] <_ami_> specing: i would like to buy a stm32 with all features.
[10:27:30] <_ami_> don't want to start with minimal board
[10:27:41] <_ami_> since in future, i would need something better for sure.
[10:28:01] <_ami_> so its a waste of money, if i buy a minimal stm32 board.
[10:28:07] <Lambda_Aurigae> I don't think any of them have ALL the features.
[10:29:26] <_ami_> specing: farnell does not sell directly to individuals here.
[10:30:07] <_ami_> i called them up before, they were least interested in selling to individuals.
[10:35:18] <specing> _ami_: so buy a stm32F7
[10:35:23] <specing> 300 megahurtz
[10:35:56] <specing> interesting, farnell seems to be the only one willing to sell to individuals here in europe
[10:36:05] <specing> 5 eur shipping
[10:36:32] <specing> try doing a checkout on mouser with $10 of stuff and it'll offer $80 "UPS SUPER SAVER" shipping
[10:39:14] <Lambda_Aurigae> I usually use digikey here.
[10:41:13] <twnqx> which is most of the time more expensive than mouser for the same parts
[10:53:41] <deepbluv> i'm on amd64 jessie and i need to install a i368 library.Should I install all dependencies i368 as well?
[10:55:52] <deepbluv> sorry,wrong channel
[10:56:11] <specing> logic is not abundant today
[11:11:17] <dos_fan]> Is there an appropriate channel for a question regarding the same70?
[11:11:46] <Lambda_Aurigae> same70?
[11:12:13] <dos_fan]> Sorry, the Atmel Sam e70.. fully realising it's not an avr
[11:13:11] <Lambda_Aurigae> doubt there is a specific channel for that.
[11:13:13] <Lambda_Aurigae> you might try #arm
[11:13:29] <dos_fan]> Thanks. #atmel was dead
[13:13:07] <hetii> Hello :)
[13:14:29] <hetii> Q: why I cannot use PB0 as GPIO when set some bits in ADMUX?
[13:14:35] <hetii> in attiny45
[13:21:38] <hetii> ok nvm I solved it:)
[13:26:08] <Richard_Cavell> I'm glad we were able to help him
[13:29:50] <Thrashbarg> yay