#avr Logs

Feb 02 2019

#avr Calendar

02:58 AM Smashcat: Hi, anyone here use atmel studio? I usually convert Arduino projects to it and it works ok, but trying a new project, and seems like it doesn't have any idea of basic variable types. Tried including <stdint.h> - no errors but it still has no idea of what (for example) uint8_t is. Is there a basic empty project I can use that includes everything?
07:28 AM jancoow: Finally some time to work on UART then :P
07:29 AM jancoow: looking for some example code tho :/
09:05 AM s-ol_: hey everyone, I'm having some beginner issues programming an ATTiny414 using the GNU toolchain\
09:06 AM s-ol_: basically whichever function is defined first in my C source (even if it has arguments) becomes the entrypoint instead of main
09:07 AM s-ol_: im compiling using avr-gcc; then linking into an ELF using avr-ld and then dumping into an intel hex file using `avr-objcopy -j .text -j .data`
09:07 AM s-ol_: when I inspect the .elf with `objdump -h -S` it still shows the correct 'start address' pointing to the 'main' symbol
09:08 AM s-ol_: I then flash the hex file with avrdude and jtag2updi
09:08 AM s-ol_: Is there a way to inspect the hex file to find out whether it still has the starting address? where even would that be stored?
09:09 AM LeoNerd: The hex file is plain values to be written directly to the flash
09:10 AM LeoNerd: So its "entry address" is whatever the chip does - the boot vector
09:12 AM s-ol_: the ihex is not binary actually, I just checked it out with help from wiki - https://en.wikipedia.org/wiki/Intel_HEX
09:12 AM s-ol_: it contains the starting address at the end, as a "Start Segment Address" record
09:13 AM s-ol_: so I assume my flashing process is to blame
09:33 AM s-ol_: from the Attiny414 sheet: "After Reset, the CPU will execute instructions from the lowest address in the Flash program memory, 0x0000. The program counter (PC) address the next instruction to be fetched."
09:33 AM s-ol_: can I tell LD to move a specific symbol to the start of the .text segment?
09:44 AM MrFahrenheit: probably gotta use an ld script
09:45 AM jancoow: Hey; I'm currently ttrying to calculate the USART.BAUD register value for my attiny414
09:45 AM jancoow: https://jancokock.me/f/e3038.
09:46 AM jancoow: https://jancokock.me/f/e3038 *. However. I don't exactly understand how. My fcpu is 8000000. So I currently have: #define USART0_BAUD_RATE(BAUD_RATE) ((float)F_CPU * 64 / (16 * (float)BAUD_RATE))
09:46 AM jancoow: However this results in a number which never fits in a 16 bit register
09:47 AM jancoow: I want to run my uart on 9600
09:53 AM MrFahrenheit: looks like that comes out to 3333, which fits in 16 bits
09:54 AM LeoNerd: The baud register isn't a full 16bit one though, is it?
09:54 AM LeoNerd: I -vaguely- recall there being a predivider
09:54 AM LeoNerd: or am I thinking of the other timers?
09:56 AM jancoow: well this is the complete code ; For some reason am I not getting the correct chars received
09:56 AM jancoow: https://jancokock.me/f/7d36b/
10:03 AM jancoow: LeoNerd: according the documentation it is :/
10:07 AM LeoNerd: Hrm.. I thought it was just 12bit? Maybe I'm misremembering
10:12 AM jancoow: Yeah weird. sending data to it works fine
10:12 AM jancoow: as in; receiving on the attiny
10:25 AM s-ol_: Figured my issue out, my avr-ld was in default configuration. Fixed it by using it through avr-gcc with the proper -mmcu=... setting :)
10:26 AM LeoNerd: 🙌
10:29 AM polprog: jancoow: http://polprog.net/papiery/avr/random/ping.c
10:33 AM jancoow: that's exactly what I'm doing polprog :/
10:33 AM polprog: oh,
10:34 AM jancoow: So receiving is working fine. However, sending data out seems going wrong. I do receive the correct amount of chars (so if I write 2 chars, I receive 2 chars). However, If I write "OK" I receive "G" and a unkown char 0xf5
10:41 AM jancoow: And i'm really not sure why
10:52 AM jancoow: any suggestions why this could be?
11:12 AM polprog: got an oscilloscope?
11:14 AM LeoNerd: Scope or LA is good for that kind of question
12:06 PM jancoow: Don't have that
12:26 PM vmt: for debugging *all* avr comms, one of those cheap LAs is more than enough
12:26 PM vmt: forgot the exact price but if memory serves it falls between $10 - $20
12:32 PM jancoow: yeah
12:32 PM jancoow: Yeah it looks like receiving is also not working properly as I expected :/
12:33 PM jancoow: So it has to be some configuration fault
12:46 PM polprog: indeed,
01:00 PM jancoow: I still thing it's something with the baudrate
01:00 PM jancoow: but I don't understand how I need to set it correctly
01:00 PM polprog: what IC is this
01:00 PM jancoow: attiny414
01:04 PM polprog: its a fractional baudrate gen
01:04 PM polprog: just so you know
01:05 PM jancoow: uhm; I'm not sure what that actually means
01:06 PM polprog: the number that you put into there is not an integer, so if you wanna put, say 15 there, you dont put 1111 in binary,
01:06 PM polprog: The 10 MSBs (BAUD[15:6])
01:06 PM polprog: hold the integer part, while the 6 LSBs (BAUD[5:0]) hold the fractional part.
01:06 PM polprog: so you put 000000 1111 000000
01:06 PM jancoow: Okay uhm so. If I want a baudrate of 9600 with the Fclk on 8mhz: (64*8000000)/16*9600 = 307200000000
01:07 PM jancoow: how would I write that correctly?
01:07 PM polprog: so, whatever your calculation result is , if its an integer, you have to shift it left by 6
01:07 PM polprog: to make up for the fraction part
01:07 PM polprog: what is this chip even? is this one of those new AVR-PIC frankensteins? :P
01:08 PM jancoow: yes :P
01:08 PM polprog: scroll down to page 255 of the datasheet
01:08 PM jancoow: that's where I'm currently looking at :P
01:09 PM polprog: you have a firmula: BAUD[15:6] = (fclk_per]/(2*fbaud)
01:09 PM jancoow: I'm in a-syncrhonous mode
01:09 PM polprog: oh ok
01:10 PM polprog: huh, so that 64* in the numerator makes up for the shift then
01:10 PM polprog: no idea really
01:10 PM polprog: :(
01:10 PM jancoow: :/
01:10 PM jancoow: Yeah the weird thing is: the correct amount of characters is okay. However, I don't receive the correct bytes
01:10 PM polprog: you can try sending 0x55 (U) and using your multimeter to measue the frequency, that should give you a rather crude idea of what the signal looks like
01:12 PM jancoow: https://jancokock.me/f/f2e4c this is the result when sending 0 - 255 over serial
01:12 PM jancoow: It doesn't make any sense lol
01:13 PM polprog: try sending 0xAA - this will give you a continous stream of 010101.... and measure the frequency of that
01:13 PM polprog: just keep bombarding the data register with 0xaa
01:13 PM jancoow: I can't measure frequency :/
01:13 PM polprog: oh snap
01:13 PM jancoow: My multimeter doesn't support that lols
01:14 PM polprog: :(
01:15 PM vmt: there's a serious tool issue at hand
01:15 PM vmt: not everything is solvable by javascript
01:15 PM polprog: i guess, double check all clock frequencies if they are correctly defined in code
01:23 PM jancoow: if you guys maybe see something worng :( https://jancokock.me/f/d29ba
02:03 PM rue_ is now known as rue_mohr
02:28 PM rue_shop3: is someone having serial issues?
02:29 PM jancoow: Yea me lols. But I'm getting to understand the fractional thiny now
02:29 PM jancoow: And i Just calculated it and it's imposible to have 9600
02:29 PM rue_shop3: ok, whats the avr?
02:29 PM jancoow: attiny414
02:29 PM rue_shop3: 414?
02:29 PM rue_shop3: no 4th digit?
02:29 PM jancoow: so I'm trying to calculate some other baudrates, but with most of the values the error is pretty big
02:29 PM rue_shop3: 4414?
02:29 PM rue_shop3: you dont have to, there is a baud calculator
02:29 PM jancoow: no, it's the new one from microchip
02:29 PM rue_shop3: wont matter
02:30 PM rue_shop3: shouldn't
02:30 PM rue_shop3: how fast is it running?
02:30 PM jancoow: okay, how can I calculate it?
02:30 PM jancoow: It's running at 8mhz
02:30 PM rue_shop3: ok
02:30 PM rue_shop3: http://ruemohr.org/~ircjunk/avr/baudcalc/avrbaudcalc-1.0.8.php
02:30 PM rue_shop3: at 8Mhz, for 9600, you need a divider of 51
02:31 PM rue_shop3: have a link to the pdf datasheet for that chip?
02:31 PM jancoow: I can't set a devider
02:31 PM jancoow: http://ww1.microchip.com/downloads/en/DeviceDoc/40001912A.pdf
02:31 PM jancoow: page 255
02:31 PM rue_shop3: UBBR
02:32 PM rue_shop3: I forgot how much I hate microchip datasheets
02:33 PM rue_shop3: which page describes the clock rate divider?
02:33 PM jancoow: for the mcu itself?
02:33 PM rue_shop3: there is a clock system for the uart
02:33 PM jancoow: Mmh. ((64 * 8000000) / (16 * 57600)) = 555.5555555555
02:33 PM rue_shop3: and part of it sets the clock divider for the baud
02:33 PM jancoow: there is?!
02:34 PM rue_shop3: did they need a 64x pll to get 8Mhz from an 8Mhz crystal?
02:35 PM rue_shop3: wtf did they do...
02:36 PM rue_shop3: they aren't saying whats needed about the uart clock gen
02:37 PM rue_shop3: well lets see
02:38 PM rue_shop3: what baud rate do you want to do
02:38 PM jancoow: I just calculated that 57600 should match perfectly
02:40 PM jancoow: If i'm not wrong ofcourse
02:40 PM jancoow: And I set the BAUDH register to: 10001010 and the BAUDL register to: 11110111
02:41 PM rue_shop3: 512 Mhz
02:41 PM rue_shop3: Bit Rate UBRR % of error
02:41 PM rue_shop3: 300 106666 0.0
02:41 PM rue_shop3: 600 53332 0.0
02:41 PM rue_shop3: 1200 26666 0.0
02:41 PM rue_shop3: 2400 13332 0.0
02:41 PM rue_shop3: 4800 6666 0.0
02:41 PM rue_shop3: 9600 3332 0.0
02:41 PM rue_shop3: 14400 2221 0.0
02:41 PM rue_shop3: 19200 1666 0.0
02:41 PM rue_shop3: 28800 1110 0.0
02:41 PM rue_shop3: 38400 832 0.0
02:41 PM rue_shop3: 57600 555 0.1
02:41 PM rue_shop3: 76800 416 0.1
02:41 PM rue_shop3: 115200 277 0.1
02:41 PM rue_shop3: 230400 138 0.1
02:41 PM rue_shop3: you might be better off leaving it in synchronous mode if you can
02:41 PM jancoow: but then I need an extra pin?
02:41 PM rue_shop3: I dont know if they change everything or not
02:41 PM vmt: oh here we go again
02:42 PM rue_shop3: it might not have to do with the actual pin config, just eh divider?
02:42 PM vmt: rue_shop3: have you ever thought of using pastebins... or for your self-reflection even notepad?
02:42 PM rue_shop3: vmt, I'm sorry, did I interrupt your conversation with somebody?
02:42 PM jancoow: rue_shop3: I can't set a divider
02:43 PM rue_shop3: jancoow, its called "baud"
02:43 PM vmt: it is considered rude to answer a question with a question
02:43 PM vmt: however, no you didn't. your turn.
02:44 PM rue_shop3: they didn't describe the clock sourcing stuff right, its splattered
02:44 PM rue_shop3: it implies there is a clock source select before there baud rate generator
02:44 PM rue_shop3: aka, selecting a slower one
02:45 PM jancoow: Yes, the clock source from the internal oscilator?
02:45 PM rue_shop3: or a divider or external source...
02:47 PM jancoow: okay :/
02:47 PM jancoow: so what to do :/
02:47 PM rue_shop3: still scanning datasheet
02:47 PM jancoow: thanks :D
02:48 PM rue_shop3: I'm DEFINITLY moving over to stm32...
02:48 PM rue_shop3: the internal osc is 16Mhz, your running at 8?
02:48 PM vmt: i've been telling that over here for years now.
02:48 PM jancoow: Yes. I divided it by 2
02:48 PM vmt: trash the avrs.
02:49 PM rue_shop3: jancoow, using which setting
02:49 PM jancoow: Because I'm running at 3.3v. 10mhz is the max allowed
02:49 PM jancoow: using the MCLKCTRLB register
02:50 PM rue_shop3: did they do that thing where you need to buy a microchip programmer "of the day" to program this, or can avrdude do it with ISP?
02:51 PM jancoow: you need a microchip programmer of the day. However, I managed to programm UDPI with my raspberry pi
02:51 PM jancoow: By just combining the RX and TX and connect it to the reset pin
02:51 PM rue_shop3: yea, they ended AVR just like I thought they would
02:51 PM rue_shop3: they will make changes that require a C compiler they sell soon
02:52 PM rue_shop3: and It'll suck
02:52 PM rue_shop3: god mircochip sucks
02:52 PM vmt: god atmel sucked
02:52 PM rue_shop3: not as much as mircochip
02:52 PM vmt: not really
02:53 PM rue_shop3: there will likley be a tiny414A come out soon, and it'll be COMPLETELY incompatible with the tiny414
02:53 PM rue_shop3: aka different registers, instructions, and programming protocol
02:53 PM jancoow: Anyhow I really don't know how to use the uart :/
02:53 PM rue_shop3: jancoow, why did you select *this* avr?
02:54 PM rue_shop3: I'm gonna bet 10c that in 2 years, this one will go out of production
02:54 PM jancoow: I've set the baud to: 10001010 11110111 Which should be a fraction (bit 0-6) of 55 and an integer value of 555. Which makes 555.55 . so ((64 * 8000000) / (16 * 555.55)) = 57600.57 baudrate
02:54 PM jancoow: rue_shop3: yeah IDK. I though it filled al my needs
02:55 PM rue_shop3: no just treat it as a 16bit register and load it with 555
02:55 PM jancoow: I needed uart
02:55 PM rue_shop3: BAUD = 555;
02:55 PM jancoow: why? The documentation says differently
02:55 PM jancoow: The 10 MSBs (BAUD[15:6])
02:55 PM jancoow: hold the integer part, while the 6 LSBs (BAUD[5:0]) hold the fractional part.
02:55 PM rue_shop3: wtf, why would they do that
02:56 PM jancoow: I don't know.
02:56 PM rue_shop3: I'm not finding a proper documenatation on the clocking system
02:56 PM rue_shop3: this is as f****ed up as a PIC datasheet
02:57 PM rue_shop3: no examples either
02:58 PM rue_shop3: aha, but they dont show the uart clock
02:58 PM rue_shop3: hahah
02:59 PM jancoow: The output frequency generated (fBAUD) is determined by the Baud register value (BAUD in USART.BAUD) and the peripheral clock frequency (fCLK_PER)
03:00 PM jancoow: ah damn. That's why this is not working. 57600 > (8000000/16)
03:00 PM rue_shop3: and this implies the perphial clock can be different than the cpu clock
03:00 PM jancoow: So I need to choose a smaller baudrate within a valid error rate
03:01 PM rue_shop3: #include <assert.h>
03:01 PM rue_shop3: */
03:01 PM rue_shop3: int8_t sigrow_val
03:01 PM rue_shop3: int32_t baud_reg_val
03:01 PM rue_shop3: = SIGROW.OSC16ERR3V;
03:01 PM rue_shop3: = 600;
03:01 PM rue_shop3: assert (baud >= 0x4A);
03:01 PM rue_shop3: max neg comp
03:01 PM rue_shop3: baud_reg_val *= (1024 + sigrow_value);
03:01 PM rue_shop3: baud_reg_val /= 1024;
03:01 PM rue_shop3: USART0.BAUD = (int16_t) baud_reg_val;
03:01 PM rue_shop3: / read signed error
03:01 PM rue_shop3: / ideal BAUD register value
03:01 PM rue_shop3: / Verify legal min BAUD register value with
03:01 PM rue_shop3: / sum resolution + error
03:01 PM jancoow: what are you doing?
03:01 PM rue_shop3: / divide by resolution
03:01 PM rue_shop3: / set adjusted baud rate
03:01 PM rue_shop3: !?!?!
03:01 PM rue_shop3: try that again
03:01 PM rue_shop3: jancoow, did you see the code on page 63?
03:02 PM rue_shop3: it sure didn't take microchip long to kill the avr arch.
03:05 PM rue_shop3: int8_t sigrow_val = SIGROW.OSC16ERR3V; // read signed error
03:05 PM rue_shop3: int32_t baud_reg_val = 600; // ideal BAUD register value
03:05 PM rue_shop3: assert (baud >= 0x4A); // Verify legal min BAUD register value with max neg comp
03:05 PM rue_shop3: baud_reg_val *= (1024 + sigrow_value); // sum resolution + error
03:05 PM rue_shop3: baud_reg_val /= 1024; // divide by resolution
03:05 PM rue_shop3: USART0.BAUD = (int16_t) baud_reg_val; // set adjusted baud rate
03:05 PM rue_shop3: looks like it offers some clues
03:06 PM jancoow: which page?
03:06 PM rue_shop3: 63
03:07 PM jancoow: so this sets the baud rate to 600?
03:07 PM rue_shop3: I kept walking, I'll let you see how it applies
03:07 PM rue_shop3: I'm looking for the diff between the cpu clock and the perph clock
03:08 PM rue_shop3: this chip is a mess of feature runaway
03:10 PM rue_shop3: I suspect this is a sign microchip is gonna tank.
03:10 PM rue_shop3: controller wise anyhow, they make a lot of good *other* things
03:11 PM jancoow: I now set the BAUD register to 1101000001100001
03:11 PM jancoow: which should be 833.33
03:11 PM jancoow: which should result in 38400 baudrate
03:11 PM jancoow: but again, doesn't work. I only receive 0x00 ...
03:12 PM cehteh: most likely you havent properly initialized it, because when the baudrate is wrong your receive garbage not 0
03:12 PM rue_shop3: you can use a serial terminal as a scope
03:12 PM rue_shop3: not easy tho
03:12 PM jancoow: I'm using a tty adapter as scope
03:12 PM jancoow: ish
03:12 PM jancoow: cehteh: yeah; but can't figure out what could be wrong about it
03:13 PM cehteh: try slow baudrate, that wotn improve the error (1% is 1% no matter if its 300 baud or 115200 baud) but slower baudrates are easier to debug and your mcu has more time to handle incoming/outgoing data
03:13 PM cehteh: well you choosen this odd chip, glhf :D
03:14 PM jancoow: rip me.
03:14 PM rue_shop3: yea, I'v never done it, but I'm on the virge of saying I dont want to learn enough about this chip to be able to hlep you
03:14 PM jancoow: If I change the baudrate it's simply receiving the wrong bits
03:14 PM rue_shop3: jancoow, whats your overall project?
03:15 PM jancoow: led dimmer board and 230v dimmer / measurement board
03:15 PM rue_shop3: ok
03:15 PM jancoow: and yes; I already have the pcbs ^^
03:15 PM rue_shop3: so, you want to take duty in over serial and set a chopper timer?
03:16 PM jancoow: yes something like that
03:16 PM rue_shop3: ... did you try loading BAUD with 555, just off chance?
03:17 PM jancoow: yes I did. But then I'm receiving wrong char values in comparison with what I'm sending
03:17 PM rue_shop3: your sending 'U' right?
03:17 PM jancoow: I'm currently sending 0x50
03:18 PM rue_shop3: send 'U' you can play with the baud rates on the terminal and work out what speed its actaully sending
03:18 PM rue_shop3: 2^n errors of speed are easy
03:19 PM rue_shop3: R1 baords are usually junk anyhow,
03:19 PM rue_shop3: :)
03:20 PM rue_shop3: would you like some bit-banged serial for a sanity check?
03:21 PM jancoow: So If I write 555 to the BAUD register
03:21 PM jancoow: and send 0x50
03:21 PM jancoow: I receive 0xC8
03:21 PM rue_shop3: ok, hold on
03:21 PM rue_shop3: 11001000
03:21 PM rue_shop3: half your terminal baud
03:22 PM jancoow: now I'm receiving 0xFD
03:22 PM rue_shop3: 11111101
03:22 PM jancoow: with BAUD=11001000
03:22 PM rue_shop3: no
03:22 PM rue_shop3: no
03:22 PM rue_shop3: leave baud with 555
03:23 PM rue_shop3: on your recieving termial, change the baud rate by half
03:23 PM jancoow: oh
03:23 PM rue_shop3: ?
03:23 PM jancoow: ah okay
03:24 PM rue_shop3: and use 0x55 for the transmitter, cause you can "see" the bit length in what the terminal recieves
03:24 PM jancoow: so sending value 0x55?
03:24 PM rue_shop3: if your sending 01010101 (0x55) and getting 00110011, then your reciever is sampling at twice the actual baud rate
03:24 PM rue_shop3: see?
03:25 PM rue_shop3: if you get 00001111 then your 4x out
03:25 PM jancoow: okay so. I'm now sending 0x55 with BAUD=555
03:25 PM rue_shop3: I usually start 'scanning' with the terminal set to 2x what I think the baud should be
03:25 PM rue_shop3: and what do you get?
03:25 PM jancoow: With 57600 I receive 0xcb
03:26 PM rue_shop3: 11001011
03:26 PM jancoow: with 38400 I receive F0
03:26 PM rue_shop3: so it still looks like the terminal is 2x too fast
03:26 PM rue_shop3: slow the terminal baud down
03:26 PM rue_shop3: a step
03:26 PM jancoow: With 19200 I receive nothing
03:27 PM rue_shop3: huh
03:27 PM rue_shop3: what do you get if the terminal is 115200?
03:27 PM jancoow: 92 and f2
03:27 PM rue_shop3: 11110010
03:27 PM rue_shop3: hmm
03:28 PM rue_shop3: how can that 2 be in there
03:28 PM rue_shop3: 10010010
03:28 PM rue_shop3: odd
03:29 PM rue_shop3: its on the edge of whatever rate its sending
03:29 PM jancoow: lol
03:29 PM rue_shop3: the F is prolly is catching the 1.5 long start
03:29 PM vmt: just get god damn debugging tools, jancoow
03:30 PM vmt: mainly a scope and an LA, or both.
03:30 PM vmt: really doesn't cost you a whole lot nowadays
03:30 PM rue_shop3: https://www.aliexpress.com/item/2-4-DIY-TFT-LCD-Digital-DSO138-SMD-Set-Measuring-Instruments-Oscilloscope-STM32-Tester-with-Acrylic/32893304581.html
03:30 PM rue_shop3: whats your budget :)
03:30 PM rue_shop3: if its just digital your doing, just get a 8 channel logic analizer
03:31 PM jancoow: Analog comes in handy to I guess
03:31 PM rue_shop3: https://www.aliexpress.com/item/USB-Logic-SCM-24MHz-8-Channel-24M-seconds-Logic-Analyzer-Debugger-for-ARM-FPGA-Logic-Analyzer/32873970588.html
03:31 PM jancoow: My budget is atm 5k-ish
03:31 PM rue_shop3: I got one of those and realized its 90% of anything I need
03:31 PM jancoow: but I'm not going to spend that on a logic analyser
03:31 PM rue_shop3: ^^
03:31 PM rue_shop3: $10
03:31 PM jancoow: with or without analog?
03:32 PM jancoow: and does it support linux?
03:32 PM rue_shop3: just digital, but $10
03:32 PM rue_shop3: yea I use it with an old copy of the salee software
03:32 PM rue_shop3: cause I only run 32 bit linux
03:32 PM jancoow: lol okay
03:32 PM vmt: saleae runs on communist foss
03:32 PM vmt: and the clones go for something like $10, yeah
03:33 PM rue_shop3: https://www.aliexpress.com/item/USB-Logic-Analyzer-24M-8CH-Microcontroller-ARM-FPGA-Debug-Tool-24MHz-16MHz-12MHz-8MHz-4MHz-2MHz/32955962512.html
03:33 PM rue_shop3: it costs less with cables and cords
03:33 PM rue_shop3: I bought a few
03:33 PM rue_shop3: my analog scope cant catch all the bits I want to see
03:33 PM rue_shop3: the load time on my 74hc595 is 7us :)
03:34 PM rue_shop3: stm32 FTW
03:35 PM rue_shop3: I bought like 20 more bluepills when the shipping went back to sane from china
03:36 PM rue_shop3: closing datasheets, I hate this avr
03:36 PM rue_shop3: https://www.avrfreaks.net/forum/attiny417-attiny814-attiny816-attiny817?page=all
03:37 PM jancoow: okay bought it
03:37 PM rue_shop3: I cant open the page, cause they set the site securrity too high
03:37 PM jancoow: I've got a headache from this shit, really
03:37 PM rue_shop3: yea!
03:37 PM rue_shop3: hey, I DO have bit-bang code if you are interested
03:38 PM rue_shop3: I'm going to dig into my stm32 project!
03:38 PM jancoow: NTY; I just want to have this to work
03:38 PM rue_shop3: been there
03:54 PM jancoow: rue_shop3: https://jancokock.me/f/c1ec3
03:54 PM jancoow: this is sending 0x55 with BAUD=3333
03:54 PM jancoow: (so that should be 9600
03:55 PM jancoow: dunno how to analyse this
03:57 PM jancoow: it doesn't really look right to me
04:01 PM rue_shop3: its got an extra bit I think
04:02 PM jancoow: I only see 5 bits
04:02 PM rue_shop3: N81, right?
04:02 PM jancoow: yes
04:02 PM rue_shop3: that looks all wrong
04:02 PM jancoow: indeed.
04:02 PM rue_shop3: the first low should be 1.5 bits wide
04:05 PM jancoow: yes and how is it possbile that there are only a total of 5 bits..
04:05 PM rue_shop3: thats 9 bits
04:05 PM rue_shop3: without a proper start bit
04:05 PM rue_shop3: no wait
04:05 PM jancoow: I count 5
04:05 PM rue_shop3: if the start bit is 1 time instead of 1.5, then thats 8 bits
04:06 PM rue_shop3: 0x55 right?
04:06 PM jancoow: yes
04:06 PM rue_shop3: msb first
04:07 PM rue_shop3: idle, start, 10101010, idle
04:07 PM jancoow: oh right!
04:08 PM rue_shop3: but the start bit should be 1.5 bit times
04:09 PM jancoow: yeah..
04:09 PM jancoow: But it's exactly the same width as the bits
04:09 PM rue_shop3: yea
04:09 PM jancoow: wtf//
04:10 PM rue_shop3: is there a start bit length register?
04:12 PM jancoow: I can't find it
04:22 PM jancoow: this is so werid
04:26 PM jancoow: rue_shop3: anyhow. I set the BAUD now on 1200
04:27 PM jancoow: baudrate*
04:27 PM jancoow: what should the lenght of the package be, in time?
04:27 PM jancoow: It now is 670us per bit, 6030us in total
04:27 PM jancoow: so 9 bits
04:28 PM jancoow: uhm well can't see the last one, because it ends with 0
04:29 PM rue_shop3: 1200 baud
04:29 PM jancoow: 1200baudrate
04:30 PM rue_shop3: 1200 is 0.83ms
04:30 PM rue_shop3: so 7.916ms
04:30 PM jancoow: I've got 670us per bit
04:31 PM rue_shop3: too slow
04:31 PM jancoow: yea
04:34 PM jancoow: weird..
04:35 PM jancoow: so what should the correct baud be?
04:36 PM jancoow: based on the 670us
04:36 PM rue_shop3: they got that fraction thing in there, and I'v only started to graze soemthing like that in my stm32 stuff
04:37 PM rue_shop3: it should be bigger, which will increase the rate
04:37 PM rue_shop3: er, increase the bit time
04:37 PM rue_shop3: you want like 830ms
04:37 PM rue_shop3: ahaha
04:37 PM rue_shop3: 830us
04:37 PM rue_shop3: :)
04:37 PM jancoow: but what bautrate is 670? :P
04:37 PM jancoow: then I can test if it works
04:38 PM rue_shop3: its not
04:38 PM rue_shop3: 415us would be the next baud down
04:38 PM rue_shop3: er up
04:38 PM rue_shop3: sorry, trying to write a state amchine
04:39 PM jancoow: mmh right..
04:39 PM jancoow: this makes no sense at all
04:40 PM jancoow: I'm going to bedl goodnights and thanks for al the help so far :D
11:39 PM day_ is now known as day