Show Posts
Pages: [1] 2 3 ... 119
1  Development / Other Hardware Development / Re: $4 Cypress PSoC 4/ 4200 Prototype Board on: July 29, 2014, 10:32:06 pm
Hi Ray,
That is great to find your post. I was just trying to tie the same hardware together (PSOC4 board and 2.2" SPI TFT).
Tonight and unsuccessfully!

If you would not mind, could you post or send me your PSOC project , so that I could look through how you got it working?
Thanks,
Bill

Bill,

I gutted much of this project:
http://www.cypress.com/?app=forum&id=4749&rID=91643
You may wish to download as I removed the SD  but if you have problems, PM me and I will email you what I have.

Ray
2  Development / Other Hardware Development / Re: $4 Cypress PSoC 4 - 4100 + Nokia 5100 code sample on: July 27, 2014, 10:41:46 am
The code for the Nokia 5110/PSoC 4100

Code:
/* ========================================
        M. Ray Burnette - Nokia B/W GLCD + 6 Channel A-D
        20140725 - Please reference "Credits_Licenses.txt"
        All code by Ray is Public Domain
        Note: Modified heap and stack constants
        Flash used: 10424 of 32768 bytes (31.8 %).
        SRAM used: 1888 of 4096 bytes (46.1 %).
 * ========================================
*/
#define GLCD_DEVICE_PSOC           //PSoC
#define GLCD_CONTROLLER_PCD8544    //Controller
#define CR 0x0D
#define LF 0x0A
#define CLEAR_SCREEN        (0x0C)
#define CONVERT_TO_ASCII    (0x30u)
#define NewLine() UART_UartPutChar(CR); UART_UartPutChar(LF);   // Used to insert a CR/LF

#include <project.h>
#include "glcd/glcd.h"
#include "glcd/fonts/font5x7.h" // Fonts for Nokia 5110
#include <ADCmux.h>             // structures

// Function Prototypes
void UART_UartPutString();

void initHarware()
{
    UART_Start();               // Property sheet sets default @9600 BAUD
    CyGlobalIntEnable;          //Enable Interrupts
    glcd_init();
    glcd_set_contrast(75);      //0== light 100==full black
    // remaining hardware initializations
    ADCmux_Start();
    ADCmux_StartConvert();   
    CyGlobalIntEnable;
    GLCD_TEXT_INIT();
}

void putdata ( void* p, char c) // part of tinyprintf() see "PrintExamples.txt"
{
UART_UartPutChar(c);
}

/* tinyprintf supports the following formats:
    'd' int as a signed decimal number
    'u' uint as a decimal number
    'c' character
    's' null terminated string
    'x' / 'X' hexadecimal with lower / upper case letters   */

// Global variables
int8 d = -10;
uint8 u = 127;
char c = 'c';                           // uint8_t c = 32;

uint8_t len = GLCD_LCD_WIDTH / 6;
    // char string[GLCD_LCD_WIDTH / 6 + 1]; // LCD line buffer
// char buffer[50];                     // serial tty original line buffer
    char buffer[GLCD_LCD_WIDTH / 6 + 1];
    // Variables for A--> D results Ports P2[0] - P2[5]
    int16 result0;
    int16 result1;
    int16 result2;
    int16 result3;
    int16 result4;
    int16 result5;


int main()
{
    // activate PSoC hardware modules
    initHarware();

    // Announce activity to PC over serial console
    UART_UartPutString("Hardware Configured\n"); NewLine(); NewLine();
init_printf(NULL, putdata);

    for(;;)
    {
        // Read all 6 of the AD channels and output
        // Single ended 4096 slices = 2.048V max = 0.500mV / slice
        ADCmux_IsEndConversion(ADCmux_WAIT_FOR_RESULT); // blocking

        result0 = ADCmux_GetResult16(0) / 2 ;
    sprintf(buffer, "Ch0 mV = %d", result0);
    UART_UartPutString(buffer); NewLine();
buffer[len] = '\0';
        GLCD_WRITE(buffer);

        result1 = ADCmux_GetResult16(1) / 2 ;
    sprintf(buffer, "Ch1 mV = %d", result1);
    UART_UartPutString(buffer); NewLine();
buffer[len] = '\0';
        GLCD_WRITE(buffer);

        result2 = 0.5 * ADCmux_GetResult16(2) / 2 ;
    sprintf(buffer, "Ch2 mV = %d", result2);
    UART_UartPutString(buffer); NewLine();
buffer[len] = '\0';
        GLCD_WRITE(buffer);

        result3 = ADCmux_GetResult16(3) / 2 ;
    sprintf(buffer, "Ch3 mV = %d", result3);
    UART_UartPutString(buffer); NewLine();
buffer[len] = '\0';
        GLCD_WRITE(buffer);

        result4 = ADCmux_GetResult16(4) / 2 ;
    sprintf(buffer, "Ch4 mV = %d", result4);
    UART_UartPutString(buffer); NewLine();
buffer[len] = '\0';
        GLCD_WRITE(buffer);

        result5 = ADCmux_GetResult16(5) / 2 ;
    sprintf(buffer, "Ch5 mV = %d", result5);
    UART_UartPutString(buffer);  NewLine(); NewLine() ;
buffer[len] = '\0';
        GLCD_WRITE(buffer);

        // glcd_test_tiny_text() ;
        CyDelay(5000) ;

    }
}
3  Development / Other Hardware Development / $4 Cypress PSoC 4/ 4200 Prototype Board on: July 27, 2014, 10:28:07 am
Microcontrollers and electronic hardware are my hobby; it has been 40 years since I made a living from "electronics."  Now retired, I enjoy the opportunity to play without having to actually have an end-game other than knowledge and a bit of fun.  So, when I stumbled onto the PSoC $4 prototype board from Cypress, I took the plunge purchasing $20 worth of boards from Mouser  (2-4100 and 3-4200) to cost justify the $5 S/H.
Quote
Note to self: don't waste time on the 4100 as it is a stripped-down 4200 design and is the same price!
  The raw uC are available directly from Cypress at $1 each/any qty with free shipping- limited time offer for folks that can do their own eval boards.

Spending $25 was nothing compared to the investment I had to make in my gray matter... lots of neurons had to be devoted to this seemingly simple technology which looks somewhat like FPGA .  The software tools will make a dent in your hard disk and your download volume from the ISP: \Programs Files\Cypress will contain over 17K files at a total of over 2G of storage (for comparison, Arduing 1.0.5 is around 8.6K of files and 660MB.) 
Quote
Note to self: Toss in another $25 because you really, really need the Pioneer board to do debugging of the firmware!)
  If you wish to debug directly on the 4200 board, you need Cypress' $99 programming tool.  All said and done, the initial investment is around $60.

I cannot remember the number of online training videos I watched, but the first 2 minutes of every 6 minute video is a sales pitch before the meat of the video is released.  Likely, I watched more than 30 videos, some from amateurs which were a complete waste of time.  If you are going to watch training videos, watch the official ones and consider the first 2 minutes an invitation to go get a cold beer.

My biggest hurdle was that I had a few ideas I wanted to explore and those ideas did not lay down with any particular training materials; so I was impatient and attempted did some stupid things in the GUI. 
Quote
Note to self: You can fry your butt in just a few clicks inside the GUI... it is not just a code editor... it is more like an intergalactic star cruiser with many self-destruct features.
  Fortunately, as you work through code and get a clean compile, you can quickly elect to create an archive of that point in time... it is compressed and time efficient and provides a great snapshot to get back to a past point in time.

My takeaway: I may never use another 8 bit AVR.  Reality: I have a drawer full of 328 and tiny85 and 1284 SO I WILL USE AVR... but I am in love with the 32-bit 4200 PSoC.  I am in love with the Cypress Creator development GUI.  It's all GCC so there are lots of similarities but you will notice that Cypress pushes C over C++ (for efficiency) and the GUI is configured for Integer and C but can easily be adjusted with a few clicks to support C++ and floating point by default.  Another interesting adjustment in the property sheet is the ability to fine-tune the stack size.  I thought it was awkward at first, but the Cypress GUI gives all help requests in PDF documents.  The project also collects and packages the required PDFs for the components utilized in a design - in a way, it is self-documenting, but at a high-level component level.  The details come in the form of a final report: (shown is a 4100 programmed for Nokia 5110 GLCD and a 6 channel analog A/D and serial I/O):
Code:
------------------------------------------------------------
Technology mapping summary
------------------------------------------------------------

Resource Type                 : Used : Free :  Max :  % Used
============================================================
Digital clock dividers        :    0 :    4 :    4 :   0.00%
Pins                          :   19 :   17 :   36 :  52.78%
Interrupts                    :    1 :   31 :   32 :   3.13%
Comparator/Opamp Fixed Blocks :    0 :    2 :    2 :   0.00%
SAR Fixed Blocks              :    1 :    0 :    1 : 100.00%
CSD Fixed Blocks              :    0 :    1 :    1 :   0.00%
CapSense Blocks               :    0 :    1 :    1 :   0.00%
8-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
7-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
Temperature Sensor            :    0 :    1 :    1 :   0.00%
Low Power Comparator          :    0 :    2 :    2 :   0.00%
TCPWM Blocks                  :    0 :    4 :    4 :   0.00%
Serial Communication Blocks   :    1 :    1 :    2 :  50.00%
Segment LCD Blocks            :    0 :    1 :    1 :   0.00%
</CYPRESSTAG>

My trek from awkward to comfortable has been 30 days and numerous hours devoted to playing, viewing videos, and keyboard work with examples and Google searches.  The best resource I found is last years 100 Projects in 100 days:
http://www.element14.com/community/thread/23736/l/100-projects-in-100-days
This group of projects covers the basic Arduino sample programs such as Blink and then goes further beyond that into real and useful projects.  Highly recommended but local storage is about 2.5G and 28K files... that is a lots of examples!

The pictures show my take on the ILI9341 SPI Color 2.2 inch display and the Nokia 5110 B/W GLCD.  The color TFT is running on a 4200 board using hardware SPI but the Nokia is on a 4100 board using software SPI/bit-banging.  Again, the 4100 and 4200 chips and boards are the same price, so make your life simple and just buy the 4200; the same PSoC used in the Pioneer board.

Recommended hardware for getting started in PSoC 4: (under $30)

If you have never worked with soft silicon before, I strongly suggest you allocate an hour a day to watch video and do this for a minimum of 2 weeks.  After that, you should have enough terminology exposure that the PDF will be satisfactory for advancement.  Do NOT avoid the example programs... silly Blink is done 3 ways in PSoC: two in hardware without any firmware and one entirely in firmware.  The ability to build logic that does not utilize any CPU resources is wonderful as the AVR only does this for PWM after firmware configuration.

Go forward with an open mind.  $30 will set you back only the price of an inexpensive dinner out for 2 people.  With $30, a month to play, and 15 hours of TV (of tablet) video time, you will be forever enlightened!

As for me, it is 32-bits and PSoC for all new projects.  I am a big believer in multi-CPU projects anyway, so I am sure many AVR chips will be used for peripheral device controllers with the PSoC being top-dog (for now, who knows what next year may bring as it is hard work being top-dog for any length of time!)

Ray
4  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 16, 2014, 07:44:08 pm
I broke a leg on the 1284 while moving it to a perfboard.

Damn me! I shouldn't be doing these mistakes after so many years?

Well, it will still run but the program will be a bit awkward?



I have used an Xacto knife before to cut (scrape) the encasement enough to solder a wire to a broken leg.  After ensuring a connection, coat with a drop of fast set epoxy.

Ray

5  Community / Bar Sport / Re: Your latest purchase on: July 14, 2014, 12:22:52 pm
TI Connected Launchpad: http://www.ti.com/tool/ek-tm4c1294xl
Several Cypress PSo4 Things, including some bare chips ($1 each!)
   Pioneer: http://www.cypress.com/?rID=77780
   Prototyping kits: http://www.cypress.com/?rid=92146 (what a great idea, as a "sample" alternative!)
I also scored an ST F4 "Nucleo" at EELive:  http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260000
So many eval kits, so little time :-(


I ordered the $4 Cypress 4200 prototyping board.  It worked nicely, but no debug without the $99 dongle.  But, the 4200 Cypress Pioneer board w/ the Arduino-compatible headers is only $25.  I received mine last week and had some quality time with it this weekend.  I'm very impressed.  The 4200 has the 32-bit Cortex M0 core, 4K of SRAM, 32K of flash no eeprom but flash can be substituted easily... yes, user software can write flash!  Code can execute from flash or SRAM!

The PSoC Creator GUI, Compiler (GCC), debugger, and kitchen sink are all in the one package - free.  The debugger works great on the 4200 Pioneer board thanks to the PSoC 5 which is acting as the USB-serial bridge and the debug interface.  Code seems to compile well for speed and small code size.  The compiler and linker can have user-supplied runline parameters set in the GUI as well as lots of customization.  A++ on the effort.  The learning curve is a bit steep, but it may be just me, too.

For $25, the Pioneer board is a must have if you want to do some mixed signal work on a single chip for cheap.  The code developed on the Pioneer can be loaded on the $4 PSoC 4200 prototype board via the serial-USB bootloader - Caveat, the bootloader does take flash and SRAM, so if you want to avoid that, the 4200 'chip' is $1 each any quantity or you can purchase the Programmer for $99 and do anything.

I compiled a simple PSoC 4200 program with an implementation of the ILI9340/9341 TFT SPI library and the stats were:
Quote
Flash used: 14142 of 32768 bytes (43.2 %).
SRAM used: 1688 of 4096 bytes (41.2 %).

The above included the TFT driver library with 20 screen functions, one font, and the main() startup and initialization for the 2.2 inch display with a few lines of graphics.

Oh, the 4200 has a 48MHz system clock!  Sweet for the price.  In my book, this is a buy if you have the patience to read and watch a large number of training videos to jump-start your activities. 
http://www.cypress.com/psoc4200/


Ray
6  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter + ILI9341 GLCD + Atmega1284P on: July 12, 2014, 11:24:57 am
I got this breadboarded yesterday and made some current measurements.
Disclaimer: I am knowingly running the 1284P overclocked at 16MHz and 3.09V from 2 AA batteries.  The current (a 20 Ohm resistor limiting the GLCD LEDs) was measured with my Fluke to be 34mA max during screen boot, and about 32mA running.  The Bobduino board is being used with the 16MHz but without a voltage regulator onboard... battery supply via the Vin pin.

Now, to address the serial ASCII entry.  I'm thinking a low-powered Bluetooth module and my old Logitech diNovo mini-keyboard.

I simply love the emulator running on the TFT display.  Way cool, Jan.


Ray

Edit... I added this code:
Code:
#include <Streaming.h>
// ...
char curkey = 0 ;
// ...
Serial.begin(19200) ;
 Serial << "AVR C64 emulator coming online at 19.2K BAUD \n \r \n \r" ;
// pito snippet
  if (Serial.available()) {
    curkey = Serial.read() & 0x7F ;
    Serial << curkey ;
    RAM[198]=1;
    RAM[631]=curkey;
  }

and changed the background TFT color for the picture.  I used TeraTerm as the keyboard.  Notice the error with the lowercase "i" in "Pi" on the TFT output.  One must completely wait after pressing Return/Enter for the TFT to stop scrolling before beginning to type again.
7  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 11, 2014, 10:03:58 am
@Ray
The request was to support a display with RA8875 controller. This kind of display, i have not seen for less than $10.

Oliver



Thank you, I totally missed the context of the response!  I agree, the RA8875 is a different beast.

Regrets,

Ray
8  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 10, 2014, 08:26:40 pm
Ok, looks nice. Still the main problem is the price. Ucglib is just a private project.

Oliver

These are available in the $6 U.S.D. range from Hong Kong.  I have received 12 out if 12 good ones in excellent condition.  They work great with 3.3V 328 @8MHz and I have had no issues over clocked at 16MHz.  Ideal mate for those $3 "mini" modules which attach to the back of the display with double-stick foam tape.
http://www.ebay.com/itm/141147721733

Bottom line, color display and UNO compatible for under $10 ...
The Adafruit GLCD works well with the Adafruit libraries if anyone is concerned about the nature of the UGClib.

Ray
9  Using Arduino / Project Guidance / Re: Ardutester - Arduino Component Tester on: July 10, 2014, 12:55:34 pm
Hi,
I have a couple of versions, but which one would you recommend me trying?

Thanks

Anthony

Gee, hard to say... Go to the oldest and try that, if it works OK, then move forward in time.  The damage I noticed showed up with diodes getting misclassified and even the anode/cathode getting swapped sometimes... Also, some weird menu problems but I cannot remember the specifics.

Ray
10  Community / Bar Sport / Re: Your latest purchase on: July 04, 2014, 08:12:43 pm
Playing around with PSoC... Just got a couple in and working through the learning curve.  So far, impressed... Completed the UART & LCD tutorials and will be trying out some of the analog modules.  GNU compiler is C++ capable but default GUI is configured for C.

Ray

http://www.cypress.com/?rid=92146
11  Community / Exhibition / Gallery / Re: Simple Calculator (5110 LCD + Ps2 Keyboard ) on: July 04, 2014, 07:08:54 pm
@endrio,

Nice, and RPN... Cool.  When I wrote my calculator,
http://forum.arduino.cc/index.php?PHPSESSID=vmf2gmq25jmd7brfum41p9ish2&topic=147550.0
I just used serial I/O but the LCD and real keyboard is a nice touch.

More pics...
http://www.hackster.io/rayburne/scientific-calculator


Bravo!

Ray
12  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:32:41 pm
...
But you're right about it being cool.
Wish I could find a keyboard that matches the size smiley

I'm thinking an old cellphone slide keyboard, or maybe a Blackberry...

One of the "for parts" eBay things...
13  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 07:19:24 am
I did a quick mock up of my VIC-20 emu on the DUE board because it has a 2.2" TFT.
This was only a test to know that the video and cpu emulation works.

Now over to the PET ROM's

Those are a real mess.
Don't even know which ones to use.


That is pretty cool to see the character-based VIC-20 screen running on a TFT graphic display and on ARM Cortex-M3.  Pretty Wow!

I'm thinking that you should be able to get the Cypress PSoC 4200 to perform the video almost exclusively without the CPU intervening which would put a 4K VIC-20 into a Minty Can size!!!  Way cool, Jan.

Also, as a testament to the 6502 emulator code, it seems to run fine on ARM Cortex.  Great job there,
miker00lz.


Ray
14  Topics / Science and Measurement / Re: voltage divider for temp sensor on: June 30, 2014, 03:00:37 pm
Quote
I used a thermistor a while ago and I could get temp readings  within 0.1C; but that was  based on the manufacturer's provided coefficients and equation.

Well, yes that is true, but thermistors are inexpensive and the data sheets for major many factors are easily found.  As always, if one goes through surplus junk to salvage parts, they are pretty much on their own to categorize the spoils.

For the above crowd, a late friend of mine posted another way to implement thermistor temperature readings.
http://www.phanderson.com/picaxe/lin_thermistor.html


Ray
15  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: June 30, 2014, 02:52:50 pm
...
It compiles and I get
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?
in my terminal.
Sorry for my naive question - what needs to be done next? When I enter a number (or I just press enter) I see nothing.. smiley

PS: I've changed to TeraTerm terminal and it seems it works:
Code:
6502 EhBASIC [C]old/[W]arm ?
Memory size ?
9231 Bytes free
Enhanced BASIC 2.22
Ready

When you press Enter in response to "Memory size?" All free (S)RAM is used... In the old days, you would type in a smaller number if you needed to load a second "piece" into RAM, maybe an assembler program.
The Cold/Warm is to permit you to have a "C" complete boot with nothing in the program space or a "W"arm boot to preserve the already loaded program. 
These things are holdovers from the original ROMs.

Ray
Pages: [1] 2 3 ... 119