[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
can anyone tell me whats wrong with my program
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 56
Thread images: 13
File: S__28827650.jpg (291 KB, 1280x960) Image search: [Google]
S__28827650.jpg
291 KB, 1280x960
i want to make USART communication serial between two microcontroller ATmega8535. i am using 2 minimum system, 3 LED as ouput, uncommon keypad as input on each minimum system. i want to make it when i press either keypad the LED turn on according to number on the button pressed. i dont know whats wrong with my program. All the LED keep turn on and not respond to the keypad.

but when i only use 1 minimum system, 1 keypad, and 3 LED, the LED is working as i want it. here's the program:

.include "m8535def.inc"
.org 0x00
rjmp main
main: ldi r16,low(RAMEND)
out SPL,r16
ldi r16,high(RAMEND)
out SPH,r16
ldi r17,0xff
ldi r19,0xfe
ldi r20,0xfc
ldi r21,0xf8
ldi r22,0x00
ldi r23,0x06
ldi r16,0xff
out ddra,r16
ldi r16,0xf1
out ddrc,r16
rcall USART_init
load: sbis UCSRA, RXC
rjmp led
in r26,UDR
out porta,r26
led: ldi r16,0x7f
out portc,r16
in r18,pinc
cpi r18,0x7f
brne led1
mov r25,r17
rcall USART_Transmit
rjmp load
led1: cpi r18,0x7d
brne led2
mov r25,r21
rcall USART_Transmit
rjmp load
led2: cpi r18,0x7b
brne led3
mov r25,r20
rcall USART_Transmit
rjmp load
led3: cpi r18,0x77
brne led
mov r25,r19
rcall USART_Transmit
rjmp load
USART_init: out ubrrh,r22
out ubrrl,r23
ldi r24, (1<<RXEN)|(1<<TXEN)
out UCSRB,r24
ldi r24, (1<<URSEL)|(1<<USBS)|(3<<UCSZ0)
out UCSRC,r24
ret
USART_Transmit: sbis UCSRA,UDRE
rjmp USART_Transmit
out UDR,r25
ret
>>
install gentoo
>>
>>53861825
wat
>>
You seriously thought /g/ can help you with actual technology related problems?
>>
File: 1459730852699.gif (215 KB, 400x524) Image search: [Google]
1459730852699.gif
215 KB, 400x524
>>53862996
this
>>
>>53863041

If you have anime on your computer you seriously need to consider either ending your life, or leaving your parents' basement in search of employment and making yourself useful to society.

It's faggots like yourself that pollute this board with bullshit
>>
>>53861800
Install gentoo
>>
>>53863533
It's just a reaction image, jeez.

I have just one serie on my computer that I rewatch yearly, and nothing else.
>>
>>53863533
>>>/reddit/
>>
>>53862996
yeah fucking noobs
won't help diagnose a bunch of unformatted, uncommented, messy assembly code

they probably don't even know the bit configuration for AVR USART by heart
>>
>>53863533
need a trigger warning for cartoons?
>>
File: 1459569904172.jpg (47 KB, 228x247) Image search: [Google]
1459569904172.jpg
47 KB, 228x247
>>53863533
>>
File: 1362467733901.jpg (42 KB, 435x419) Image search: [Google]
1362467733901.jpg
42 KB, 435x419
>>53861800
cool clock ahmed
>>
>>53861800
what kind of english is this btw
>>
so...uuuh

what about those new polaris cards??? will it run fallout 8?

smartphones anyone???

xD
>>
>>53863851
technology at the micro level is so boring, if you're fascinated enough by the amount of detail and complexity that is put into making hardware/software you probably have autism.
>>
Check connections. Maybe you connected RX to RX and TX to TX, insead of TX-RX RX-TX.
Maybe you didin't initialize USART properly - check the datasheet.

And also it's easier in C.
>>
File: 1268461485340.jpg (37 KB, 410x380) Image search: [Google]
1268461485340.jpg
37 KB, 410x380
>>53863905
>doesn't understand how things work
>'probably autism'
stay classy /g/
>>
>>53863905

right on bro! u see the new tessellation on batman's cape? out of this wolrdd!

so... iphone 6s or do i wait for next LG flagship?

post you're desktop1
>>
>>53863961
>>53863969

>LOOK, I can organize the 0s and 1s in cool ways! Isnt this fun!

wew lad
>>
>>>/diy/ for actual technology

/g/ is for consumer electronics, hobby operating systems, tech support for /v/ and JavaScript homework help.
>>
>>53864021
>I can only understand technology concepts if there is a huge layer of abstraction because I'm not actually smart and don't like putting in work!!

wew faggot
>>
Hi op, if you're still here
you're going to have much better luck posting in
>>>/diy/ohm

/g/ is literally retarded when it comes to real technology, they only know about smartphones and graphics cards
>>
>>53864021

you tell em my bro!

are you TEAM GREEN? can't wait for 1080ti!!!xD

post ur abttlestation
>>
>>53864031
>>53864052
Please don't make the retard op post his crap on /diy/.
>>
>>53864052
>they only know about smartphones and graphics cards
That's quite a generous statement
>>
This thread physically hurt me. /g/ is so dead
>>
>>53864065
it's practically guaranteed he knows a far sight more about computers than you do

>>53864076
you're right, after seeing ^^^ I take that back
>>
>>53864040
Yep its totally because im not smart and not because its dull and repetitive.

Sorry id rather think outside a box than create one.
>>
File: 1383880803190.jpg (32 KB, 311x278) Image search: [Google]
1383880803190.jpg
32 KB, 311x278
>>53864021
>'people actually like computerz'
>'ahah what lozers, let me post about it on my magic device, cant possibly understand so these guys must b autistik xDDDDD'
>'vape nation yall'
wew lad
>>
>>53864083
At least more than you.
But this is clearly OP's first AVR project, that wasn't flashing a led.
>>
>>53864150
you're a special kind of retard aint ya
>>
>>53864150
>I'd rather think outside a box
>only creates things inside of boxes that other people have created

haha sure told me
>>
>>53864153
Not that guy, but how do I get better at tech?

I don't have anything to experiment with at home, sadly.
>>
>>53864082
I've been thinking of moving to reddit - FUCKING reddit lately.

Can you imagine that?
>>
File: s-l500.jpg (22 KB, 347x500) Image search: [Google]
s-l500.jpg
22 KB, 347x500
>>53864202
good starting point, you need to get components and a multi meter at the bare minimum. There's a lab workbook that follows the 3rd edition of this book that's supposed to be pretty good.
>>
>>53864248
appreciate this, anon
>>
File: 1375074198168.gif (3 MB, 174x200) Image search: [Google]
1375074198168.gif
3 MB, 174x200
>>53864317
go fourth my son
>>
File: 1457326558579.png (312 KB, 645x313) Image search: [Google]
1457326558579.png
312 KB, 645x313
>>53864358
Seeing people wanting to be less ignorant makes me hard too.
>>
Fixed it now, op?
>>
File: 1413162922560.jpg (7 KB, 174x200) Image search: [Google]
1413162922560.jpg
7 KB, 174x200
>>53864559
mass erect
>>
>>53864714
still not working, i will to try ask it on /ohm/. btw thanks for the respond guys and sorry for bad the english because english is not my first language. just let this thread die
>>
>>53861800
is this a bomb?
>>
OP, please post in hex. I can't read assembly.
>>
File: E1451871515648.png (215 KB, 894x894) Image search: [Google]
E1451871515648.png
215 KB, 894x894
>>53863533
I just want to trigger this faggot
>>
File: afraid.jpg (215 KB, 1182x966) Image search: [Google]
afraid.jpg
215 KB, 1182x966
>>53863533
>>
First, don't be an asshole and use code tags.
Second, I've never used any form of assembly I understand the basics though.
It appears the system is searching for which pin to turn on by hooking to one addr and you don't update that addr to off.
>>
>>53861800
forgot about semicolon
dont worry is a noobie mistake
>>
>>53863764
Holy shit kek
>>
>>53870322
kinda
>>
>>53871616
sorry the code tags got messed up because i didn't give a space between code
>>
File: 1325855355425.jpg (315 KB, 1250x1036) Image search: [Google]
1325855355425.jpg
315 KB, 1250x1036
>>53863533
is this your first time on /g/ or what
>>
>>53870375
here the .hex:
http://www.mediafire.com/download/5vygygk4g7e5eda/USART.hex

what applicaton do you use to read .hex file?, when i open it on notepad it just binary or hexadecimal code
>>
>>53861800
Unless your course demands it, I'd rather get a cheap FPGA from Amazon and do all the coding on VHDL.
>>
>>53874401
my lecturer demand to use only non-SMD component, manual soldering, and assembly language programming
>>
>>53864224
After finding some retro computing people and a good share of comfy gnu/Linux folks, I've actually been having a pretty nice time... On fucking Tumblr.
Thread replies: 56
Thread images: 13

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.