It seems the problem is solved. (Although I still don't understand why my first attempt didn't work...)
Now I use BUTTON as included in Picbasic. I don't like all the labels, but at least this works...
Type: Posts; User: RuudNL; Keyword(s):
It seems the problem is solved. (Although I still don't understand why my first attempt didn't work...)
Now I use BUTTON as included in Picbasic. I don't like all the labels, but at least this works...
In the meantime there is some progress:
CMCON = 7 ' Digital mode
DEFINE OSC 20 ' 20 MHZ OSC. ...
I doubt it... It is a brandnew one!
What I find extremely strange, is that it seems the status of PORTB.x is not read in:
if PORTB.0 = 1 then
Serout2 PORTB.7, 16384+12, [144, 44, 127] ...
It doesn't. I tried already:
If PORTB.0 = 1 then
PORTB.6 = 1
else
PORTB.6 = 0
' and loop...
I never had problems setting the config parameters in the programmer, but I will try that anyway...
I have a feeling that the problem is in the line:
if PORTB.0 = 1 then '<---- this line?
...
I set the config parameters in the programmer (as usual).
The values you mentioned are the defaults in my programmer, except the HS mode, that I set manually.
The point is that everything (almost)...
So nobody can spot a mistake in my sample code?
Strange, because this line is handled correctly:
If (PORTB.0=1) or (PORTB.1=1) or (PORTB.2=1) or (PORTB.3=1) or (PORTB.4=1) then
.....
The 16384+12 is correct, I have used that before.
The calculation is: (1.000.000/Baudrate) - 20 , so 1.000.000 / 31250 = 32 -20 = 12.
For inverted output set bit 14, = 16384.
But even with a...
I forgot to mention that there are resistors to ground (to keep the input 'low' when no button is pressed) and that the buttons switch to the +5 Volts.
Hello,
After not having used picbasic for a couple of years, I decided to create some code to produce MIDI information.
The intended use is to have five buttons to control a DAW.
The code...
No idea what was wrong, but now it works.
(It may have been the FTDI USB to serial cable.)
I am trying to read the serial (RS232) input on LEDs, connected to PORTB of the 16F876.
(Later this will be part of a larger application, I need both PORTB and PORTC as outputs.)
I am using an FTDI...
OK, let's forget this all and use a dedicated USB to MIDI chip...
Nobody knows? Too difficult?
Is there any sample code available to have a PIC18F4550 recognized by the PC as an (USB) MIDI device?
(And yes, I know it is mainly finding the correct device descriptor...)
I have been struggling...
Interesting! This is what I get when I connect a commercial USB-to-MIDI interface
Connection Status : 0x01 (Device is connected)
Port Chain : 5-2
PortAttributes ...
Great! That will give a lot of useful information about a commercial USB/MIDI interface!
Thanks!
I will have a look at it and see if I can use it.
By the way: what did you use to retrieve that long list of information about the PicKit2 programmer?
Yes, that is probably the way to go, I only wished I had a PBP programmed USB device that would do MIDI...
The information about the PIC2 programmer gives a lot of information, but it doesn't do...
Yes, I think you are right.
Besides that, I think $400 is not real for an application like this.
Especially because you can't get an idea what you will buy...
Wow, that is a lot of (probably) useful information!
The next question is: how to generate a descriptor file from this...
Thanks!
By the way: I saw HIDmaker Pro. That looks like an interesting...
Thanks!
The first link is my previous question, that never received a usable answer. (Although some reactions had good intentions.)
The second link does not give any code, the code could be...
I have been experimenting with MIDI over USB for some time, without much success.
It seems there is more needed than only a HID descriptor, to have a PIC (18F4550) recognized as a 'MIDI Device'....
DaveC3, your code has been a great help so far.
Unfortunately, I didn't manage to get it working.
I suppose there is something wrong with my fuse settings.
Do you mind to give me your config...
Which PIC did you use? (I will first try if everything compiles before I modify the file(s) )