Can anyone help me translate a very small piece of code written for the 12F683 (on which the 08M is based, I believe). I'm just starting out on all this electronics stuff, so if anyone can help, I'd be very grateful.
See http://www.micro-examples.com/public/microex-navig/doc/077-picobat.html
* picoBAT : an ultra simple ultrasonic bat detector
*******************************************************************************
*
* Author : Bruno Gavand, February 2009
* see more details on http://www.micro-examples.com/
*
* source code for mikro C compiler V8.2
* feel free to use this code at your own risks
*
* target : PIC12
*
* PIC PIN Assignemnt :
*
* GP0 GP1 : piezo speaker
* GP5 : ultrasonic transducer receiver
*
*******************************************************************************
*/
void main()
{
/*
* configure GPIO as digital port
*/
CMCON0 = 7 ;
ANSEL = 0 ;
TRISIO = 0 ;
GPIO = 0b01 ;
for(;
{
/*
* toggles speaker outputs
*/
GPIO ^= 0b11 ;
}
}
The code divides the input frequency by 16 bringing it down to our hearing range.
Cheers all.
See http://www.micro-examples.com/public/microex-navig/doc/077-picobat.html
* picoBAT : an ultra simple ultrasonic bat detector
*******************************************************************************
*
* Author : Bruno Gavand, February 2009
* see more details on http://www.micro-examples.com/
*
* source code for mikro C compiler V8.2
* feel free to use this code at your own risks
*
* target : PIC12
*
* PIC PIN Assignemnt :
*
* GP0 GP1 : piezo speaker
* GP5 : ultrasonic transducer receiver
*
*******************************************************************************
*/
void main()
{
/*
* configure GPIO as digital port
*/
CMCON0 = 7 ;
ANSEL = 0 ;
TRISIO = 0 ;
GPIO = 0b01 ;
for(;
{
/*
* toggles speaker outputs
*/
GPIO ^= 0b11 ;
}
}
The code divides the input frequency by 16 bringing it down to our hearing range.
Cheers all.