QBF (Quick Brown Fox) Serial Test Generator

mrburnette

Senior Member
20120907 UPDATE: New Code published with additional functionality.
See: #post207784

Now on Instructables:
http://www.instructables.com/id/QBF-Test-Generator/

I had this need to do some testing on a prototype and I needed a signal generator for ASCII. In the old days of working in military buildings without windows, we had this test equipment that would put out "RY" for Baudot testing of teletypes. (The equivalent ASCII code would be U* in case anyone wonders.)

I decided that this is a good time to reach into my spare PICAXE08M2+ bin and sacrifice for all times a chip that needs no support parts at all and construct an ASCII signal generator. I left three functions unimplemented, but I documented what I was thinking... build it on out or change to suit. One enhancement I did implement was the start-up recognition of whether the 5V RS232 protocol should be _N or _T... the default is 9600_N since I needed this to work with PC terminal. Simply jumper physical pin #5 to GND to invert the signal to 9600_T. I implemented the weak pullups, so no external pullups are required.

While the 64 Byte message is stored in EEPROM, the signal generator outputs this message from RAM to avoid any hiccups that potentially may occur... not that I know of any, but the RAM is there and some may find this a creative use for the RAM. Others may be bored.

- Ray

Code:
; A Quick Brown Fox ASCII serial test pattern generator
; Public Domain 20120610 by M. Ray Burnette
; 59 bytes / 2048
#picaxe 08m2
#Terminal 9600

SYMBOL CLOCK = m16
SYMBOL BAUDMODE_T	= T9600_16	; Txxx give a true output (idle high) "T=0"
SYMBOL BAUDMODE_N = N9600_16	; Nxxx give an inverted output (idle low) "T=4"
SYMBOL MONITOR	= C.0	; RS232 output on this pin

SYMBOL BAUD		= b0
SYMBOL Looper	= b1

SetFreq CLOCK
pullup %00011110		; Manual 2 page 159  08M2 bit0-bit4 = C.1 to C.4

; PIN_1 is POSITIVE		PIN_8 is GROUND
; PIN_2 is C.5 is serial_in	PIN_7 is C.0 is serial_out
; PIN_3 is C.4 is future	PIN_6 is C.1 is future
; PIN_4 is C.3 is future	PIN_5 is C.2 is HIGH = _N & LOW = _T

BAUD = BAUDMODE_N		; Default to "Inverted" TTL RS232 signaling "idle low"
				; Swap to _T mode if indicated
IF PINC.2 = 0 then	; IS the Physical pin #5 0n 08M2 at ground?
	BAUD = BAUDMODE_T	; Default to "Inverted TTL RS232 signaling "idle high"
ENDIF

; Example: For Scott Edwards display: BAUD = BAUDMODE_N
; Example: For SparkFun display:      BAUD = BAUDMODE_T
; Example: For PC Hyperterminal:      BAUD = BAUDMODE_N
; The defaults should allow the chip to communicate with the PC

PAUSE 8000
DISCONNECT			; Stop polling for Serial Input

; Load higher RAM memory with EEPROM string
bptr = 28			; BANK 0 == addresses 0 --> 27 for Named Variables
For b1 = 0 to 63
	READ b1, @bptrinc
Next b1

; Spool string from RAM forever...
Do
	bptr = 28
	For b1 = 0 to 64
		serout MONITOR, BAUD, (@bptrinc)
	Next b1
	serout MONITOR, BAUD, (CR, LF)
	Pause 1000
Loop

' 64 Bytes
; "$" included for future enhancement to allow qualifier testing
EEPROM 0, ("$The Quick Brown Fox Jumped Over The Lazy Dogs Back.0123456789!#")

; IDEAS for future enhancements
; PIN3 port C.4 selection for Output (default) and Input (receiving on Pin2)
; PIN4 port C.3 selection for an alternate output character stream, "U*" for example
; PIN6 port C.1 selection for an alternate BAUD, perhaps 4800
View attachment 11479

UPDATED: 20120611 To Add "U*" serial output switch to pin#4
See: #post207784
 
Top