I am currently doing a voiced controlled robot (as instructed by the book "PIC Robotics" by John Iovine) that requires the use of a PIC16F84 microcontroller to decode the output of the speech recognition chip HM2007.
I got the following programming code from that book.
--------------------------------------------------------------------------
'Speech recognition interface program
symbol porta = 5
symbol trisa = 133
symbol portb = 6
symbol trisb = 134
poke trisa, 255
poke trisb, 240
start:
peek portb, b0
if bit4 = 0 then trigger 'Trigger enabled, read speech recognition circuit
goto start 'Repeat
trigger:
pause 500 'Wait .5 second
peek portb, b0 'Read bcd number
if bit5 = 1 then send 'Output number
goto start 'Repeat
send:
peek porta, b0 'Read port a
if bit4 = 1 then eleven 'Is the number 11
poke portb, b0 'Output number
goto start 'Repeat
eleven:
if bit0 = 0 then ten
poke portb, 11
goto start 'Repeat
ten:
poke portb, 10
goto start 'Repeat
end
--------------------------------------------------------------------------
After I installed PicBasic Pro Compiler Demo and chose the targer processor to 16F84, I got 21 errors in the above programming code. What is wrong? Is the book wrong?
I am new to programming and microcontroller so please help! (with plain english of course as I am not very familiar with this kind of stuff^_^)
Also can I use "Programming Editor for PICAXE" to load the program into PIC16F84 chip? Or do I have to use ProBasic for PIC16F84?
Bookmarks