How to complie ?
- Visual C++ 2008
- Hi-Tech PIC C Compiler
- RS232 or equalivent(usb2serial conveters) interface
- Any PIC microcontroller with Timer1 and USART
- Other parts in the schematics
There is no specific PIC for this project if your selected device has a Timer1 and USART module that’ll be okay. (In the experiment I used pic16f74).
Now follow those steps
- Open .\soft\rand\build.cmd with any text editor and change the “–chip=16f74″ to your device
- Open .\soft\rand\firm.h and change the address of Timer1 accordingly. (The addres’ll be in the datasheet of device)
- Run build.cmd, download the rand.hex to PIC
- Build devman and devcom with Visual C++ (they are in .\soft\dev_lib)
- Copy devcom.dll and devcom.exe to Windows directory
- Open .\soft\devman.inf , change Port accordingly and copy to Windows directory
Library is ready to use now. If you want to make a test, build & run rand_test. Device will start 10 seconds after power up.
For questions you can contact wtih me via email.
Why devman.exe don’t scan serial ports ?
Device isn’t plug & play. If some body disconnect or cut its power, that may cause unpredictable behaviour.
How can I change the baudrate ?
Change SPBRG in rand.c at line 121. SPBRG = [(20Mhz/16*BaudRate) - 1].
Change dcbConfig.BaudRate in devman.c at line 273 accordingly.