Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I think my family's ride on the London Eye was a quid per 1.25 uSec.My keyboard or sys config doesnt let me use the dollar symbol.
A quid can last me 1.25 microseconds on bill day.
I think my family's ride on the London Eye was a quid per 1.25 uSec.
You can get Chinese copies for almost nothing at all, which probably do everything you need.
USB Logiic Analyzer 24M 8CH Microcontroller ARM FPGA Debug Tool
Only US$13.99, buy best USB Logiic Analyzer 24M 8CH Microcontroller ARM FPGA Debug Tool sale online store at wholesale price.www.banggood.com
;-----------------------------------------------------------------------
; Shift register (31-bit) pseudorandom (white) noise generator
;-----------------------------------------------------------------------
%TITLE "NOISE31.ASM"
IDEAL
DOSSEG
MODEL tiny
DATASEG
shift_reg dd 5a5aa55ah ;a nice seed
speaker_off db 0
speaker_on db 0
welcome db 0ah,0dh
db ' NOISE31 - A "white" noise generator based on a 31-bit shift'
db ' register',0dh,0ah
db ' (as suggested by Don Lancaster).',0ah,0dh,0ah,0dh
db 0ah,0dh,' - ----------------------------- -'
db 0ah,0dh,' - Done For Fun by: -'
db 0ah,0dh,' - xxxxxxxxxxxxxxxxxxxxxxxx -'
db 0ah,0dh,' - xxxxxxxxxxxxxxxxxxxxxxxx -'
db 0ah,0dh,' - xxxxxxxxxxxxxxxxxxxxxxxx -'
db 0ah,0dh,' - ----------------------------- -'
db 0ah,0dh,0ah,0dh
db ' (Press any key to Exit)',0ah,0dh
db '$'
CODESEG
ORG 100h
start:
mov ax,02h ;clear the screen
int 10h
mov dx,offset welcome ;display message
mov ah,09h
int 21h
;get speaker_off setting
mov dx,61h ;speaker port
in al,dx
and al,0fch
mov [speaker_off],al ;save speaker off
out dx,al ;start it off
or al,02h
mov [speaker_on],al
gen_num:
;Determine the result of (bit three xor bit six) of the high
; byte of the shift register and put the result in the carry.
mov bx,[WORD HIGH shift_reg]
and bh,048h ;08h or 40h is result=1 else 0
cmp bh,08h
jz xor1
cmp bh,40h
jz xor1
clc ;xor result=0 so clear carry
mov al,[speaker_off] ;and set speaker byte
jmp short shift_bits
xor1:
stc ;xor result=1 so set carry
mov al,[speaker_on] ;and set speaker byte
;Rotate the shift register with the cf becoming the lsb.
shift_bits:
rcl [WORD LOW shift_reg],1
rcl [WORD HIGH shift_reg],1
;The cf has our random bit but al has our speaker out byte.
;toggle speaker
out dx,al ;out the speaker
;check for a key press to end
@@10:
mov ah,1
int 16h
jz short gen_num ;no press
mov ah,0
int 16h ;trash press
mov ah,4ch
int 21h ;-->DOS
END start
;----------------------------------------------------------------------
; Translation of a white noise generator from PIC12F675 to PIC10F202
; Original code from: https://electricdruid.net/white-noise-source/
; by Tom Wiltshire
; GP2 pin 3 (on 8p pdip has the output to be consistent with the
; MM5837 - other output pins are possible
;----------------------------------------------------------------------
LIST P=10F202
include "p10f202.inc"
__CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF
;
; RAM Variables
CBLOCK 0x08
; LFSR 1, a 31-bit register
LFSR1_1
LFSR1_2
LFSR1_3
LFSR1_4
; LFSR 2, a 23-bit register
LFSR2_1
LFSR2_2
LFSR2_3
; Temporary storage
TEMP
ENDC
;----------------------------------------------------
org 0x000
movwf OSCCAL
; note: use default OPTION reg values
movlw b'11011100' ; for GP2 out
OPTION
;**** Setup GPIO inputs/outputs ****
movlw b'00000000'
movwf GPIO
movlw b'00001011' ; GP2 as output (pin 3 on 8p pdip)
TRIS GPIO
; Set up initial values of the registers
movlw 0x45
movwf LFSR1_1
movlw 0x57
movwf LFSR1_2
movlw 0x9F
movwf LFSR1_3
movlw 0xF2
movwf LFSR1_4
movlw 0xD7
movwf LFSR2_1
movlw 0xC8
movwf LFSR2_2
movlw 0x79
movwf LFSR2_3
MainLoop:
; 31-bit LFSR with taps at 31 and 28
swapf LFSR1_4, W ; Get bit 28
movwf TEMP
rlf LFSR1_4, W ; Get bit 31
xorwf TEMP, F
; Shift the XORd bit into carry
rlf TEMP, F
; Shift the register
rlf LFSR1_1, F
rlf LFSR1_2, F
rlf LFSR1_3, F
rlf LFSR1_4, F
; Output the noise bit
movf LFSR1_1, W
movwf GPIO
; 21-bit LFSR with taps at 21 and 19
rrf LFSR2_3, W ; Get bit 19
movwf TEMP
rrf TEMP, F
swapf LFSR2_3, W ; Get bit 21
xorwf TEMP, F
; Shift the XORd bit into carry
rrf TEMP, F
; Shift the register
rlf LFSR2_1, F
rlf LFSR2_2, F
rlf LFSR2_3, F
; Output the noise bit
movf LFSR2_1, W
movwf GPIO
goto MainLoop
END