![]() |
Forum Index : Microcontroller and PC projects : Pulsing the Micromite
Author | Message | ||||
micronut Newbie ![]() Joined: 03/09/2014 Location: United StatesPosts: 37 |
I have an application where I need to take a byte from an array and convert it to a FSK (Frequency Shift Key) output to be read into a ZX81 tape input. For the ZX81 to read data correctly each bit of a byte is tested. If the bit is 0 a chain of 4 cycles with a period of 300uS and 50% duty cycle is generated, If the bit is 1 then 9 cycles are generated. The line is held low for 1300uS between bits. There are two ways I can think of doing this. 1. Use the Pulse command in a for loop such as the following for a low bit Pin(1) = 0
for I = 0 to 3 Pulse 1, 0.015 Pulse 1, 0.015 next I Pin(1) = 0 Pause 1.3 2. Use Timers and PWM: Set the PWM to produce the 300uS period and set the timer to generate an interrupt at the proper time to stop the PWM at 4 or 9 cycles then do a Pause 1.3 between bits. This one is trickier since timing has to be somewhat precise to get the cycle count right. Is MMBasic quick enough to do this or will I have to make a CFunction that works with this? |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
This is not really FSK (which the later Spectrum used). I would stick to the pulse method. I think it will be easier to get the timing right. setpin 2, dout Pin(2) = 0 for I = 0 to 3 Pulse 1, 0.015 pause 0.015 next I Pause 1.3 You will probably have to reduce the two PAUSE times to account for program execution times. I am not sure how 'fussy' the ZX81 is but it worked on cassettes so it must have a fair bit of leeway. Jim VK7JH MMedit |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@micronut I like the idea that I think you maybe trying to achieve! Might have to get my ZX81's out of the attic! Please reveal more about your end goal if you don't mind . . . . WW |
||||
micronut Newbie ![]() Joined: 03/09/2014 Location: United StatesPosts: 37 |
My plans are to make a solid state "cassette player" for the ZX81. Most of the ZX81 programs have been converted to files you can find on many sites. So I wanted to take these files and load and save them to a ZX81 without the need of a PC to convert the files. At SellMyRetro.com they sell the ZXPand which can instantly load and save ZX81 "P" files but I wanted to see if I could put something together with what I have on hand. In fact I have used a Parallax Propeller based board and a serial LCD and made a circuit that does load ZX81 files from a SD card to the cassette input. I have used it for a year without any problems. I want to upgrade because it can only show short file names and many files use long file names. When I have more than 5 files with similar names I see a hexadecimal hash for the name making the display meaningless. Also I want to save files but the ZX81 output is attenuated by a factor of 100 so I need either an amplifier or a adc to sample the input. I originally was going to hack the SD file code in the Propeller to do long file names but that is rather complex and memory consuming. I do have an obsolete Fez-Domino board that can handle long file name files. I decided to try this but the Fez is very slow with the overhead of running the Micro .Net framework so it cannot pulse fast enough. In fact I hooked up a TFT screen to it and it took 30 seconds to clear the screen! So I thought of using the Fez to read the file then serially send it to the Micromite so it could pulse the output and use its adc to sample the ZX81 input. Today I found that Atmel's Atmel Software Framework can handle long file names with a SD card and I have an Arduino Due that can use it. The Due also handles TFTs well. So I'm going to try to use this with FreeRTOS to handle the file conversions and do a GUI on the TFT. WW if you are interested I'll post schematics and the code for the Propeller board. Also if I get the Due to work I can post it too. |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@micronut You have obviously made some good progress with the concept and a MicroMite version of a solid state 'drive' would be a great exercise and a fantastic result to achieve. Do let us know how you get on with this 'project' - I will keep a keen eye on this one . . . . WW PS Thanks for the offer of the Propellor info. If you have no issues then please email me (or PM me if theres any available space!). Thanks in advance for this . . . . ![]() |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |