Jump to content

PIC To LPC communication


Geerinckx
 Share

Recommended Posts

Hi All,

I'm working on a big project with a LPC core controlling several LCD's Buttons,Led's.

LPC17 core's can't control touch sensors so I have a PIC 18F in slave.

I've connected Tx(25) pin from the PIC to J11 MI1 P2.1 from the LPC.

I've made a copy from a pic (Old MIDIBox64 Project but still running 100% OK) with the PIC burner

The Midibox64 project has been configured for the MIDIbox - to - com link.

In the extern "C" void APP_Init(void)

I've set these lines:

MIOS32_UART_BaudrateSet(1, 38400);

MIOS32_MIDI_Init(0);

But nothing works, On midistudio I get an debug message from the midi receive handler(LPC) ==> Timeout on port 0x20

I don't know what I'm doing wrong..

Also when i measure with a scope on pin 1 from the 74hc165 from the first touch sensors. i've get pulses for the first 5 a 10 seconds after thad noting.

Ive tested the pic in the old Midibox 64 project and thad works fine.

I'm stuck,

Anybody an Idea?

Thx

Gert

Link to comment
Share on other sites

TK,

I don't really know whats happening in the PIC, I know the pic works in an older midibox (using pre-made pcb's from SmashTV).

This is on my own pcb, i dubbel checked every connection. I only can see if the pic is alive by meassuring the the clock or LD signals on the 74hc165.

The first 10 seconds I've get puls trains after thad it just stops.

I test the transfers before and after its "crash",

The settings I've made in the LPC are correct?

Do I have to test UART0 or UART1 in my recieve midi package function? It's kind of confusing when reading the MIOS32_MIDI functions....

I've made the midi connection to port p2.0 & p2.1

Thanks

Greeting

Gert

Link to comment
Share on other sites

I don't really know whats happening in the PIC, I know the pic works in an older midibox (using pre-made pcb's from SmashTV).

This is on my own pcb, i dubbel checked every connection. I only can see if the pic is alive by meassuring the the clock or LD signals on the 74hc165.

The first 10 seconds I've get puls trains after thad it just stops.

It makes sense to troubleshoot this first before continuing with the LPC17 connection.

One possible reason for a "crash" (resp. hang-up) could be, that there are no pull-up resistors connected to Pin RA4 and RD5

It could happen that the MB64E application tries to read from a BankStick, and if it reads an "undefined" value (e.g. 0 instead of 1) then it could wait endless since clock stretching is assumed.

The settings I've made in the LPC are correct?

yes

Do I have to test UART0 or UART1 in my recieve midi package function? It's kind of confusing when reading the MIOS32_MIDI functions....

I've made the midi connection to port p2.0 & p2.1

That's UART0 (internally - in the software - we are counting from 0, for the users we are counting from 1)

Best Regards, Thorsten.

Link to comment
Share on other sites

TK,

Pulling up RA4 solved the hang up problem.

But than i getting a lot of random not midi like data in midi studio.

I've changed the UART settings to:

MIOS32_UART_BaudrateSet(0, 38400);

know I've got normal midi transfers.

pot's are working, but a lot of sjitter. but this can be a power supply issue. I check Thad out a soon as possible.

But my touch sensors won't work. non of them. But i don't have anny pulse train on J14

I'm using Midibox64 project.

Anny thoughts about Thad?

Greetings

Gert

Link to comment
Share on other sites

Hi Gert,

I've currently no bandwidth to check your setup at my side, please continue debugging!

(I never tried other baudrates than the common MIDI baudrate on the LPC17 core)

J14@PIC: it's enabled with the DEFAULT_TOUCH_SENSOR_SENSITIVITY in your setup file.

Could it be, that you set it to 0 in your configuration?

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...