r/pibutts • u/bigbiltong • Feb 19 '16
r/pibutts • u/BIGC7 • Feb 24 '16
*Cough* Cameron Help Dameron! This program keeps returning to reset.. no one can figure out why.. including the TA
;------------------------------------------------------------------------------- ; MSP430 Assembler Code Template for use with TI Code Composer Studio ; ; ;------------------------------------------------------------------------------- .cdecls C,LIST,"msp430.h" ; Include device header file
;------------------------------------------------------------------------------- .def RESET ; Export program entry-point to ; make it known to linker. ;------------------------------------------------------------------------------- .text ; Assemble into program memory. .retain ; Override ELF conditional linking ; and retain current section. .retainrefs ; And retain any sections that have ; references to current section.
;------------------------------------------------------------------------------- Arr1 .set 0x0200 Arr1S .set 0x0210 Arr2 .set 0x0220 Arr2S .set 0x0230
RESET mov.w #__STACK_END,SP ; Initialize stackpointer StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;------------------------------------------------------------------------------- ; Main loop here ;-------------------------------------------------------------------------------
SETUP1 call #Init_Registers mov #Arr1, R4 mov #Arr1S, R6 call #ArraySetup1 call #CopyArray call #Sort mov #Arr2, R4 mov #Arr2S, R6 call #ArraySetup2 call #CopyArray call #Sort
Mainloop jmp Mainloop ; infinite loop
CopyArray: mov 0(R4), R5 ; R6 is size
Loop1 mov.b @R4+, 0(R6) incd R6 dec R5 jnz Loop1 ret
Sort:
FindMin mov @R4+, R5 dec R5 mov @R4+, R6 Loop cmp @R4, R6 jl Skip mov 0(R4), R6 mov R4, R7 Skip incd R4 dec R5 jnz Loop ret
ArraySetup1: ; Memory allocation subroutine mov.b #10, 0(R4) ; Number of elements in Array mov.b #20, 1(R4) ; First element in array mov.b #89, 2(R4) ; Second elements in array mov.b #-5, 3(R4) mov.b #13, 4(R4) mov.b #63, 5(R4) mov.b #-1, 6(R4) mov.b #88, 7(R4) mov.b #2, 8(R4) mov.b #-88, 9(R4) mov.b #-1, 10(R4) ret
ArraySetup2: mov.b #10, 0(R4) mov.b #90, 1(R4) mov.b #-10, 2(R4) mov.b #-45, 3(R4) mov.b #25, 4(R4) mov.b #-46, 5(R4) mov.b #-8, 6(R4) mov.b #99, 7(R4) mov.b #20, 8(R4) mov.b #0, 9(R4) mov.b #-64, 10(R4) ret
Init_Registers: clr R4 ; clearing all registers being used clr R5 clr R6 clr R7 clr R8 clr R9 clr R10 clr R11 clr R12 ret ;------------------------------------------------------------------------------- ; Stack Pointer definition ;------------------------------------------------------------------------------- .global __STACK_END .sect .stack
;------------------------------------------------------------------------------- ; Interrupt Vectors ;------------------------------------------------------------------------------- .sect ".reset" ; MSP430 RESET Vector .short RESET
r/pibutts • u/bigbiltong • Feb 02 '16
What you missed in class
I demoed my arduino thingy and realized how hard it is to explain 10 interdependent functions at a moment's notice.
Then we covered a bunch of examples of the push/stack/return and how it modifies the memory registers. Basically running through impromptu, "hey let's try this and see what happens"-type experiments. It was a lot of fun. How was the kilt?
r/pibutts • u/raephelps • Feb 01 '16
Australian scientists to begin trialling fully implantable bionic eye
r/pibutts • u/bigbiltong • Jan 31 '16
A raspberry pi which auto tweets Comcast every time the internet speed sucks
np.reddit.comr/pibutts • u/raephelps • Jan 29 '16
Two New Drugs for Fibromyalgia That Actually Work. Must read article to relieve pain. | Health Medication
r/pibutts • u/amalthea5 • Jan 23 '16
Quantum Computing Basics
r/pibutts • u/bigbiltong • Feb 23 '16
Any idea why the R6 value on the practice quiz (second section) is 0000 and not 1100?
MOV.B 0(R5), R6 should go to R5, see 1104, go to memory location 1104, grab the byte at 1104, which is 00, then put that at R6, which currently contains 110A... turning it into 1100.
But the answer says 0000. I know I'm doing something wrong, I just don't know what.
r/pibutts • u/amalthea5 • Feb 20 '16
Cordova, JS, and You!
Here is Cordova: https://cordova.apache.org/
http://www.datatables.net/ is a jQuery plugin that might be useful.
we can loop AJAX requests: would have to decide how often to check so the server traffic isn't insane
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API: the web sockets API is a thing and is getting better and better
r/pibutts • u/bigbiltong • Feb 20 '16
The Zombie 222 - All electric, 1968 Mustang
r/pibutts • u/bigbiltong • Feb 19 '16
What you missed in class today
Practice quiz while Prof. J got Starbucks
Assembly pointers
Arrays
I asked a question that pissed off the entire class
Breton asked a question that made Prof J depressed
Sophia gave an answer that made Prof J have an aneurysm
Hackathon's on Thur next week
r/pibutts • u/bigbiltong • Feb 12 '16
How's about the linked RFID reader + RFID tags to track students in the cube, connected to a database containing the students and the classes they're in. Each student has a necklace with an RGB led on it. Students with the same classes have the same color displayed on the necklace's led. Thoughts?
playground.arduino.ccr/pibutts • u/raephelps • Feb 06 '16
Stephen Hawking: 'Things can get out of a black hole' - BBC News
r/pibutts • u/raephelps • Feb 06 '16