Thursday, March 5, 2015

Giving Cypress a Try - for Jül - PSoC to Arduino to Huhushop OLED... Let's See

If this works, then the next step would be to try and dump stuff to the OLED from the phone by getting the PSoC BLE to receive it.. let's do a CBM first..

Start with the UART TX example code, delete the LCD thing in the schematic, and the code..

Build succeeds..

Then, using RealTerm... no luck.. Bombs..

Then, I try stuff from here : https://eewiki.net/display/microcontroller/PSoC+UART+Example

And that bombs - can't even find device.h ... man.. talk about Arduino compatibility - they suck..

Anyhow, I then search for PSoC4 BLE serial port hello world and get to :

http://www.cypress.com/?rID=101641

And I decide to try the ADC mit pre-amp example - I do a create workspace using that example (find example project) and then strip out all the other stuff, so I'm left with just :

void main()
{
    uint8 i = 0;

    /* Start the Components */
    UART_Start();
 
    /* Enable global interrupts */
    CyGlobalIntEnable;
 
    for(;;)
    {
        UART_UartPutChar( i++);
        delay( 1000u);    /* bad.. see below */
    }
}

Let's see... Note that, till now, I've no clue whether this UART will write the "Arduino compatible" pins.. And, as I learnt in the class, I try a right-click on the UART component hoping to get to API documentation - no luck..

Well, if they're shipping 2 billion of these a year, they're doing something right :)

Damn, there's no such function as delay. Why can't they make the thing smart enough to suggest that one might mean CyDelay - I mean, doesn't the perl compiler tell you where you might have made a mistake? Anyhow, fixes that, but still, not one peep on the RealTerm..

What's a mensch to do? I search for "pioneer cy8ckit-042-ble which pin of psoc is arduino tx rx?" .. in vain..

Changed (I think) to P1.5 for the TX and the Heap Size to 0x400 (instead of 0x100 default). And, WORKS!

Then, I see that that is the right port for Arduino already - you can see the silkscreen there.. Good. So, what happens if we connect to the Arduino pin 0 (RX)???

Works! Of course, I changed the code to
     uint8 i = 65;

To get letters on the OLED. Great! Now I need to get meaningful data from the phone to the OLED.. Be nice if I could just use the Mbientlab - but that piece of crap can't be programmed over USB.

No comments:

Post a Comment