Many thanks for the efforts you have all put into explaining things for me. Some of it has helped and I feel that I have grasped a tiny bit of programming mentality.
I have now spent the last 5 or so days working through some of the PBP examples. I've also been working through an online ASM course so as to try to grasp some of the background to the PIC16F62X datasheet, which I have also been trying to absorb parts of.
To be blunt, it isn't sinking in. I fear that it's likely to be beyond me (again - just like 6502 was 20 years ago when I did my college work, , and just like C was 5 years ago when I went on a 1 week beginner's course).
The frustrating thing is this: I think I have identified that what I want to do is almost trivial!
Please have a look at my plan if you have a few moments:
1) detect a rising edge on an input clock signal, frequencies f <= 100Hz - use portB.0 interrupt
2) Use that as a trigger to generate f/2, f/3, f/4... f/8 from remaining port B output pins
and/or
3)provide portA.0 "f/n" output where n is derived from a 4 bit switch on port A1..4 - some kind of binary or decade counter type approach I suppose.
4) Every time that rising edge occurs on PortB.0, transmit 0xF8 serial out of the USART (MIDI clock @ 21.25 kbps)
5) Detect two other pins' (e.g. A.5 and A.6 ) rising edges and transmit other words (0xFA or 0xF0) out of the USART. This could be done by ANDing with B.0 I suppose.
I'm hoping to use a PIC16F628 seeing as it has the hardware USART I think I need. I have someone else's assembler code which is used for the other part of the project,namely to read a MIDI data stream and provide TTL pulses when certain MIDI events occur (start/stop/continue and clock)
Am I right in my assertion that all of this is easily within the capability of a 20MHz MCU?
Cheers
RMC
Bookmarks