GCC code is not working on my prop
Shizu
Posts: 16
in Propeller 1
So, recently I have bought P8X32A DIP40. I wired it on my soldering breadboard with ATMEL 24C256 and use CP2102 module for uploading. The blink programm written on PASM or Spin works without problems. But for some really unclear reason GCC code is not working. I mean, PROPGCC compiles it without any problems and loader loads it without any problems to EEPROM and RAM. But after it did it - nothing happens. I tried to convert Spin code to C and load it - no effect.
PS. I tryed it with SimpleIDE (Ubuntu 16.04 LTS). And also on other Linux machine with compiled from source propeller-gcc.
PS. I tryed it with SimpleIDE (Ubuntu 16.04 LTS). And also on other Linux machine with compiled from source propeller-gcc.
Comments
For sure prop-gcc does work.
Copied from gcc documetation:
Another really simple one:
This is Makefile for non-IDE project:
In SimpleIDE I also added switch -D=xtal1pll8x in compiller options and run simple
The first example you posted compiles and runs fine from SimpleIDE (I changed the pin value to 26 for an Activity Board). The blink is a bit fast though.
The second example does not compile: P0 is undefined. Once defined it runs fine (P0 = 26 for an activity board)
The second example does not compile; Missing '#' before 'include' and 'my_pin' is undefined. It runs fine when these are corrected.
To clarify, you are running this from a Linux systems (or VM) and not something like a Raspberry Pi, correct?
Do you have an diagram of the circuit you are using?
Do you have anything besides that CP2102 such as an FTDI chip-based module?
Are you using that latest version with the latest library?
If I recall I think SimpleIDE defaults to the Activity board.
I think schematic will look like:
I was making breadboard exactly how it looks on schematic (I guess, you dont want be bothered by trying figure out what can be wrong on wired soldering board).
But as I mentioned before, I am using AT24C256 (seems it is the same IC). Instead of prop plug or FTDI, i am using CP2102 (As you see, it it worked without problems when uploading with PropellerIDE, and no error messages when I was uploading with SimpleIDE) DTR pin of CP2102 connected to RES pin of P8X32A. And I am using 8 MHz crystal. But as it was said in upper posts, P8X32A starts with its own RC-oscillator and should work without problems.
gcc version 4.6.1 (propellergcc_v1_0_0_2411)
mikeologist,
I can open Memory Map in PropellerIDE, and there I can set mode and frequency settings for my configuration.
It is really weird. Maybe I have something wrong with propeller mode options (mcog, mlmm, etc). Or I should put EEPROM IC out of socket, and make dump of it contents. Maybe I have to try FTDI module. Maybe I have to try put out of socket P8X32A and try uploading to RAM without any additional connections. Maybe I have to try to load from Windows (I not believe Linux machine (not virtual) can make problems in this situation, though I have to try it also)
Be careful of the transistor pinouts - a 2N2222 has different pinouts between manufacturers - a PN2222 is often called a 2N2222 but has different pinouts to the normal 2N2222.
propellergcc_v1_0_0_2131-x86_64-macosx.tar.bz2
https://code.google.com/archive/p/propgcc/downloads
Using the command line example from the following.
https://sites.google.com/site/propellergcc/downloads
I changed the blinkcogs example so it would blink LED 26 on a Propeller and then compiled it:
Then using 'propeller-load' from the PropellerGCC package, loaded the code on an Activity Board
This loaded without issue, however it did not run. I had to reset the board (PWR switch set to 0 then back to 1) and the code started to run.
Perhaps you need to reset your Propeller circuit to get it to run.
After all these years, it is difficult to believe Parallax has not fixed this schematic.
And, of course, you ought to use a 5 MHz crystal at least until you better understand how to push the envelope.
produces a half second pulse on the LED
This is using the compiler built into the IDE and not your make routine and on windows
Mike
I made some changes to your make file and main.c.
In your Makefile you were running the load command twice. Also, the ">&" was not liked by the shell. I added a "OUT_EXE = main" just to ensure 'main' was being loaded.
Also, ensure you are using the proper TTY instance for your Prop.
Try this:
Although your 'main.c' may work as written, to be clearer you might want to change the 'DIRA' statement to:
That is considering your LED is on pin 0.
This is what I see when running the Makefile with the changes I suggested against an Activity Board. NOTE: I did change the PORT and PROPGCC location for my environment.
Again, after loading, I had to power cycle the board to get the code to run.
I hope this helps.
The Propeller chip works since you can download Spin and PASM to it so it's your C code or GCC that's the culprit.
What version are you using?
Have you also tried from another computer?
JonM,
No effect.
Genetix,
gcc version 4.6.1 (propellergcc_v1_0_0_2411) compiled from source
SimpleIDE picked up from downloads section from parallax site.
It's my bet that the downloaded is failing due to the reset circuit being wrongly implemented.
Should I solder how it looks on this schematic?
Every now and then I need to download a program a 2nd time using Windows 7 and I have used both the QuickStart and Activity boards with SimpleIDE without trouble.
Both of those boards have on-board FTDI USB-to-Serial chips.
Windows is sometimes quirky with USB.
Is your Windows user account an Administrator?
Unfortunately none of those schematic show 0.1 uF (marked 104) decoupling capacitors across the power pins (Vdd to Vss).
Look at page 38 of the PE Kit text and note the 2 yellow capacitors that go from Vdd (3.3V) to Vss (GND) on each side of the Propeller chip.
https://www.parallax.com/sites/default/files/downloads/122-32305-PE-Kit-Labs-Fundamentals-Text-v1.2.pdf
If I recall not having these capacitors could cause the PLL (clock frequency multiplier) to burn out.
There are likely to be reset problems without using this circuit. The more resets required during loading (I believe GCC loaders do this for a multilevel download) the more likely the failure. Its both timing and polarity sensitive, and is OS dependant too. Just like the problems you are describing.
Make sure both power pins are tied together, and both ground pins are tied together (4 pins on a QFP). Not connecting any of these will likely result in a PLL failure in the chip (will not work in crystal mode)!!! If that is not directly, you will need bypass capacitors on both sides of the DIP package. You should also have 10uF (tantalum preferred) across the pins supplying them, expecially if there is some distance from the 3V3 regulator.
Could you provide the error message that you are seeing from the SimpleIDE Build Status window?
Does Device Manager show your USB device?
Considering your are using a CP2102 on your board, you may need to install a separate Driver outside of what Parallax provides with SimpleIDE
https://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/where-can-i-download-drivers-for-cp2102-usb-to/e971a3e1-d037-4ed3-9fa6-2f4a27eae0c0?auth=1
To understand from the initial issue, you are able to load both PASM or SPIN (I'm assuming using PropellerIDE) code to the Propeller circuit without issue, correct? Also, it looks like you were able to load the code from the SimpleIDE on Linux. Did it run?
You may want to check your code considering much of what you have posted has had issues and did not compile or run as posted.
I did notice that in some of the examples you posted you show a PIN value of 16 for the Blinky LED and others PIN 0. What pin is your Blinky LED connected to? Is it possible that you are running your code against the wrong pin number for where the LED is connected?
Just a suggestion.
Nope, when BOEn is low, the prop pulls it up internally (through 5K)
UART-module reset from short circuit. So if I am not using button in my circuit, and even I have no problems with uploading code it maybe no need Soldering it? Am I wrong? Anyway, it is good idea to put mcu out of socket and make transistor reset circuit on non-soldering breadboard. I will post result soon here.