Bluetooth Vic20
Moderator: Moderators
- taborj
- Vic 20 Drifter
- Posts: 31
- Joined: Fri Oct 17, 2014 3:11 pm
- Website: http://obsolete.site
Re: Bluetooth Vic20
Should be pretty simple to port Chris Baird's code to load programs via serial to use Bluetooth. There's a PC-side element, but he provides source code, so it might be portable to Android.
http://www.megalextoria.com/forum2/inde ... oto=255518&
Great work!
http://www.megalextoria.com/forum2/inde ... oto=255518&
Great work!
Re: Bluetooth Vic20
Thanks, hit a snag now - I can't receive anything (not that this is esential for my intended use, but would be nice to get it working both ways).
I'm back on the PC under VICE. The same setup receives okay to a terminal Window.
Never done serial on the Vic before, any gotcha's I should be aware of?
I'll try on the real Vic tomorrow to see if it's anything related to VICE user port emulation.
Code below
I'm back on the PC under VICE. The same setup receives okay to a terminal Window.
Never done serial on the Vic before, any gotcha's I should be aware of?
I'll try on the real Vic tomorrow to see if it's anything related to VICE user port emulation.
Code below
Code: Select all
10 OPEN 1,2,0,CHR$(10)
20 FOR I = 0 to 20
30 PRINT#1," hello from vic 20 (under vice)" + str$(I) + CHR$(13) + CHR$(10)
40 next i
70 get #1, A$
80 PRINT ">" + A$ + "<"
90 goto 70
100 CLOSE 2
Re: Bluetooth Vic20
Looks like the RS232 User Port emulation is faulty in VICE. The below code works fine on a real Vic 20. I can type on my phone keyboard and see the output on the Vic (and Vica-Versa) thus demonstrating two-way bluetooth comms. Only transmit from VIC->phone works under VICE.
https://drive.google.com/file/d/0BypVxY ... sp=sharing
Code: Select all
10 OPEN 1,2,0,CHR$(10)
20 FOR I = 0 to 2
25 INPUT MSG$
30 PRINT#1, MSG$ + str$(I) + CHR$(13) + CHR$(10)
40 next i
52 PRINT "waiting for reply..."
70 GET #1, A$
72 IF ST<> 0 THEN PRINT ST
80 if A$ <> "" THEN PRINT A$;
90 goto 70
100 CLOSE 2
Re: Bluetooth Vic20
Ok, some more progress...
I've now created an Android app that acts as a Speech Synthesiser for the Vic-20 (and Commodore-64) over this cheap Bluetooth adaptor. The following patten is used to send commands to it...
Here is a video demonstrating it in operation on real hardware (excuse the poor camera work and typing errors).
[youtube]eQt2srY1BcU[/youtube]
Next step is to add in support for playing sound samples.....
I've now created an Android app that acts as a Speech Synthesiser for the Vic-20 (and Commodore-64) over this cheap Bluetooth adaptor. The following patten is used to send commands to it...
Code: Select all
10 OPEN 1,2,128,CHR$(10)
20 PRINT#1, "say:" + "This is example speech"
30 CLOSE 2
[youtube]eQt2srY1BcU[/youtube]
Next step is to add in support for playing sound samples.....
Re: Bluetooth Vic20
I'm impressed and eagerly anticipating cloud storage for my VIC programs via my phone! 

Re: Bluetooth Vic20
Create an android socket and send vic commands to internet. You can read files directly from net. 

Re: Bluetooth Vic20
I've now added support for sample playback...
Demo of sample playback for Gorf and Wizard of WOR...
[youtube]xm0aJw1GrV4[/youtube]
Code: Select all
10 PRINT#1, "play:gorf/bad.wav"
20 PRINT#1, "play:gorf/move.wav"
30 PRINT#1, "play:gorf/space.wav"
40 PRINT#1, "play:gorf/cadet.wav"
[youtube]xm0aJw1GrV4[/youtube]
- joshuadenmark
- Big Mover
- Posts: 1180
- Joined: Sat Oct 23, 2010 11:32 am
- Location: Denmark
- Occupation: Old and tired
Re: Bluetooth Vic20
This is cool, wow
I am so impressed 


Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
____________________________________________________
In need of a wiki logon - PM me
Re: Bluetooth Vic20
If anyone would like to try this, here are some rough guidelines.
The Android app can be downloaded here. You will need to allow untrusted install and change your phone settings (be sure to revert them straight after).
The app has two modes of operation "normal" and Vocoder (which is enabled using the check box). With vocoder, all unrecognised commands are treated as Text-To-Speech. Select this mode for using with (e.g.) the Scott Adams adventure series. In normal mode two commands are currently supported:--
say:<speech> - Queues up some text to be sent to the TTS engine.
play:<filespec> - Queues up a sample to be played back.
The app should create the following directory structure on your SD card...
-/sd
+--/Vic20HelperData
......+--/samples
............+--sample.wav
...where you can place your samples (create sub-folders if required). The relative path to the file is then referenced in the "play:" command
Adapter
=======
As already mentioned you will need to get the FC-05 bluetooth adapter module, a user port plug and a PC USB->TTL adapter parts mentioned in this post. Should all cost <$10.
http://www.ebay.co.uk/itm/USB-to-RS232- ... 27f1476c01
Try to get the HC-05 module with a small switch on it that you can hold down at power on to put it into AT mode.
http://www.ebay.co.uk/itm/Wireless-Seri ... 2599a79c31
http://www.ebay.co.uk/itm/COMMODORE-64- ... 58bb926a01
I used the following guide to solder up the connector..
http://biosrhythm.com/?p=1136
When you have the adapter connected to your PC.
1) Download and install the apropriate drivers [search: PL2303HX drivers]
2) Once the drivers are installed open a terminal window, connect to the device at 38400 and enter the following command to set it to 2400 board "AT+UART=2400,1,0"
3)You can then use the device either with Vice (latest nightly - transmit only) or connect to your real Vic.
4) If using vice, set RS232 as below (Vice Settings)...
4) Pair up the device using the bluetooth settings on phone (the default password is 1234).
5) Install and run the app on your phone/tablet
6) Click Connect and your device should be listed. After it's connected press the back button.
7) Try the following test program and you should hear speech..
Vice Settings
========
In VICE Menu: Settings|RS232 Settings|RS232 Settings...
set all four ports as follows:
\\.\com3: baud=2400 parity=N data=8 stop=1
\\.\com3: baud=2400 parity=N data=8 stop=1
\\.\com3: baud=2400 parity=N data=8 stop=1
\\.\com3: baud=2400 parity=N data=8 stop=1
In VICE Menu: Settings|RS232 Settings|RS232 Userport Settings...
set as follows:
[X] Enable RS232 user port emulation
Userport device [RS232 DEVICE 2]
Userport baud rate [2400]
Troubleshooting
==========
1) Ensure that the PL2303HX is working correctly by looping the RX/TX pins with a paper clip (other wires disconnected) and you should be able to type into a terminal window (local echo disabled) and see what you're typing.
2) You can use the PC and the PL2303HX connected to the HC-05 , pair your phone up to the HC-05, and use a terminal on the PC and BlueTerm on Android to check basic connectivity
3) You can use BlueTerm on Android instead of the App to check what commands are being received from the Vic or VICE.
4) If you power cycle the Vic, the App will disconnect, you will need to reconnect the App using the Connect button.
The Android app can be downloaded here. You will need to allow untrusted install and change your phone settings (be sure to revert them straight after).
The app has two modes of operation "normal" and Vocoder (which is enabled using the check box). With vocoder, all unrecognised commands are treated as Text-To-Speech. Select this mode for using with (e.g.) the Scott Adams adventure series. In normal mode two commands are currently supported:--
say:<speech> - Queues up some text to be sent to the TTS engine.
play:<filespec> - Queues up a sample to be played back.
The app should create the following directory structure on your SD card...
-/sd
+--/Vic20HelperData
......+--/samples
............+--sample.wav
...where you can place your samples (create sub-folders if required). The relative path to the file is then referenced in the "play:" command
Adapter
=======
As already mentioned you will need to get the FC-05 bluetooth adapter module, a user port plug and a PC USB->TTL adapter parts mentioned in this post. Should all cost <$10.
http://www.ebay.co.uk/itm/USB-to-RS232- ... 27f1476c01
Try to get the HC-05 module with a small switch on it that you can hold down at power on to put it into AT mode.
http://www.ebay.co.uk/itm/Wireless-Seri ... 2599a79c31
http://www.ebay.co.uk/itm/COMMODORE-64- ... 58bb926a01
I used the following guide to solder up the connector..
http://biosrhythm.com/?p=1136
When you have the adapter connected to your PC.
1) Download and install the apropriate drivers [search: PL2303HX drivers]
2) Once the drivers are installed open a terminal window, connect to the device at 38400 and enter the following command to set it to 2400 board "AT+UART=2400,1,0"
3)You can then use the device either with Vice (latest nightly - transmit only) or connect to your real Vic.
4) If using vice, set RS232 as below (Vice Settings)...
4) Pair up the device using the bluetooth settings on phone (the default password is 1234).
5) Install and run the app on your phone/tablet
6) Click Connect and your device should be listed. After it's connected press the back button.
7) Try the following test program and you should hear speech..
Code: Select all
10 OPEN 1,2,3,CHR$(10)
20 PRINT#1, "say:hello world"
Vice Settings
========
In VICE Menu: Settings|RS232 Settings|RS232 Settings...
set all four ports as follows:
\\.\com3: baud=2400 parity=N data=8 stop=1
\\.\com3: baud=2400 parity=N data=8 stop=1
\\.\com3: baud=2400 parity=N data=8 stop=1
\\.\com3: baud=2400 parity=N data=8 stop=1
In VICE Menu: Settings|RS232 Settings|RS232 Userport Settings...
set as follows:
[X] Enable RS232 user port emulation
Userport device [RS232 DEVICE 2]
Userport baud rate [2400]
Troubleshooting
==========
1) Ensure that the PL2303HX is working correctly by looping the RX/TX pins with a paper clip (other wires disconnected) and you should be able to type into a terminal window (local echo disabled) and see what you're typing.
2) You can use the PC and the PL2303HX connected to the HC-05 , pair your phone up to the HC-05, and use a terminal on the PC and BlueTerm on Android to check basic connectivity
3) You can use BlueTerm on Android instead of the App to check what commands are being received from the Vic or VICE.
4) If you power cycle the Vic, the App will disconnect, you will need to reconnect the App using the Connect button.
- joshuadenmark
- Big Mover
- Posts: 1180
- Joined: Sat Oct 23, 2010 11:32 am
- Location: Denmark
- Occupation: Old and tired
Re: Bluetooth Vic20
Thanks for this firmly instruction.
I have ordered the parts and looking forward to follow your guide to a speaking Vic
I have ordered the parts and looking forward to follow your guide to a speaking Vic

Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
____________________________________________________
In need of a wiki logon - PM me
Re: Bluetooth Vic20
Wow, this is essentially a low cost high quality speech synthesiser....If you ignore the android phone cost. Excellent work. Will be interested to build this when I am on holiday.
Vic20-Ian
The best things in life are Vic-20
Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
The best things in life are Vic-20
Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
- taborj
- Vic 20 Drifter
- Posts: 31
- Joined: Fri Oct 17, 2014 3:11 pm
- Website: http://obsolete.site
Re: Bluetooth Vic20
Android phones can be had cheaply, too, if you don't need the service to go with it. Actually, my current normal phone was $28 at Walgreens (ZTE Zinger from the T-Mobile pre-paid section). Dual-core processor and everything. More than enough for this app.
Re: Bluetooth Vic20
Hello, I would like to inform you about a project I finished during the X-mas holidays. I tidied it up a little bit and made a small webpage describing it. I was announced on http://commodore.hcc.nl a little while ago. I'm also trying to get it posted on hackaday but for some reason they don't seem to respond (yet).
This is my project page:
http://jderogee.tripod.com/projects/Blu ... hesis.html This also contains a small youtube video (https://www.youtube.com/watch?v=8pPSYTCudCs) to give an impression in how it works & sounds.
The funny thing is that I needed to use the HC-06 because the HC-05 should not support 2400 (according to the datasheet).
Anyway, good to see that others had the same idea. Which indicates that it wasn't such a bad idea.
The power of the smartphone is amazing and combining it with modern technology in this simple way is great.
Ok, speed is pretty low, but still fast enough for transferring small amounts of data/files.
Kind regards,
Jan Derogee
This is my project page:
http://jderogee.tripod.com/projects/Blu ... hesis.html This also contains a small youtube video (https://www.youtube.com/watch?v=8pPSYTCudCs) to give an impression in how it works & sounds.
The funny thing is that I needed to use the HC-06 because the HC-05 should not support 2400 (according to the datasheet).
Anyway, good to see that others had the same idea. Which indicates that it wasn't such a bad idea.
The power of the smartphone is amazing and combining it with modern technology in this simple way is great.
Ok, speed is pretty low, but still fast enough for transferring small amounts of data/files.
Kind regards,
Jan Derogee
Re: Bluetooth Vic20
It looks like we did the same thing, although my hardware solution isn't as neat as yours. I managed to get the HC-05 working and added the ability to play sound samples.
Re: Bluetooth Vic20
If someone could make these things in a case ready configured to 2400 baud I think there would be a potential small market considering it works with the C64 as well