1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

I can not write the firmware on ATMEGA8535

Discussion in 'SimTools compatible interfaces' started by tonquites, May 7, 2011.

  1. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello friends developers, :hi:

    I need help! :sos:
    I'm building a Tronic's Full motion simulator car racing, but I have problems with the AMC.
    I can not write the firmware on ATMEGA8535-16PI - Atmel.

    01.jpg

    Here is a photo in high resolution view of the board up and down.
    02.jpg
    03.jpg

    This is the second AMC board I did and the two are the same type problem.

    The program PonyProg2000 not find the serial port interface.

    I follow the steps of Thanos_ponyprog_guide1_1.pdf:

    1 - Start up the AMC in force
    2 - Connect the serial port cable programming.
    3 - Run the program PonyProg2000.
    4 - Click on OK. The Following window appears.
    5 - You need to run Calibration from the Options menu before any read / write operations
    Click on OK
    6 - Select 'Setup -> Calibration'
    Calibration OK
    7 - Select Setup -> Interface Setup 'and set up as shown below (Serial SI Prog I / O, COM1) and
    click on Probe.
    'Test Failed' message appears. :no:
    04.jpg
    05.jpg

    These are the tests I did:
    - Tested the PonyProg2000 versions: v2.06f BETA, BETA v2.07a and v2.07c BETA.
    - I tested the connection with the AMC program PonyProg2000 on 3 different PCs with Windows XP 32 bits installed.
    - Build two AMC with all different components.
    - I checked the serial port was open in the BIOS of the 3 PCs
    - I tried using the crystals 24, 22 and 18MHz.

    Can I have bought 2 atemga8535 damaged?
    I have to disclose any serial port in Windows XP?

    Sorry for bad English.
    I thank google for helping me translating Portuguese into English

    Thanks for the help
    :thbup:
    Everton Quites
    Brazil
  2. pippo978

    pippo978 New Member

    Joined:
    Jun 1, 2009
    Messages:
    20
    Location:
    Carini
    Balance:
    1,052Coins
    Ratings:
    +0 / 0 / -0
    Hello
    I too have had problems in the building of the AMC Thanos. Your problem is you do not recognize the programming interface, and until it recognizes it will not be able to program atmega8535. Try to check all the soldering, make sure there are no cold solder joints and components on the program interface are all working. Use a power supply has enough amps (Thanos recommend 1A). Only after passing this problem you can try to program atmega8535, trying first with a 4MHz crystal and then maybe going to the one 18MHz. I so I could program my own.

    Regards
    pippo978
  3. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello pippo978
    Fenix ​​beautiful avatar. Thank you for the reply. :yippiee:

    I'm a beginner in electronics, but hardworking and ready to learn. :happy:

    I am very happy to join this community, I hope to develop and if possible, also help the community. :highfive:

    As for the problems:

    - I have very careful when soldering, but cold solder may be the problem. I will make the solder again.

    - I tested all components before soldering.

    - The source of power is adjustable from 1.5 V up to 24V and maximum current of 1.5 A. I adjusted the 8V to the AMC.

    - I will buy a 4 MHz crystal because of this I have not.

    I'm using ST232CN replacing the MAX232. There is some problem in this exchange? :(

    What amazes me is that AMC built a second to minimize the chance the problem happen, but it did not.

    Thanks for the tips.
    Everton
  4. pippo978

    pippo978 New Member

    Joined:
    Jun 1, 2009
    Messages:
    20
    Location:
    Carini
    Balance:
    1,052Coins
    Ratings:
    +0 / 0 / -0
    Hello

    I too am not experienced in electronics, before being able to run my AMC I built two. I came to redesign the PCB and buy new components.
    Just a small welding does not hurt to make everything work.
    The max232 used by you, I do not think can cause problems, I read the datasheet and is sold as a substitute for max232.
    The problem you're experiencing is still tied to the part dedicated to the program, check that the serial cable is properly connected and that is pin to pin.

    Regards
    pippo978
  5. rafael_design

    rafael_design Member

    Joined:
    Feb 17, 2011
    Messages:
    202
    Occupation:
    CGI Architectural Visualizations with Blender 3D
    Location:
    Brasil
    Balance:
    328Coins
    Ratings:
    +19 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hi, you have to be very carefull with the cable you are using. I had a lot of trouble with it. If you are using an usb cable must have in mind that they can have two types of chips and only one is the right one (generally the most expensive). I personally conected it straight to the motherboard idc10 pin headers (SERIAL COM). This method is pin to pin so there is no need for chip based usb cable.
    regards!
    :cheers:
  6. R-eng

    R-eng Member

    Joined:
    Aug 4, 2008
    Messages:
    141
    Location:
    San Diego, CA, USA
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    Hi Everton,
    Sometimes the ini file needed changes to work with the 8535, so you may check if you have this, as it worked perfectly for me. I use v2.07c

    If you use the 4Mhz Xtal, match the (2) capacitors to 20pf (which also works with the 18.432Mhz).

    The (Data I/O port) St232CN is a CMOS device and the (4) capacitors next to it should be 0.1uf ( no more than 1uf) and not 10uf, which may cause issues. But this will not affect the PP2000 programming through the Prog port. Good luck.

    R-eng

    Attached Files:

  7. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello pippo978, rafael_design and R-eng :hi:

    I am very thankful for the tips, I'll test all the tips! :yes:

    It took me to answer because I was trying to cold solder joints. The results it seems that I have no cold solder.
    I will post all the results you get with the oscilloscopes.

    Many images of all points involved in programming. If anyone is curious can compare with your AMC that can help.

    01.jpg

    02_5V.jpg

    Cable RX-RX...
    03_data_RX.jpg

    04_5V_RX.jpg

    05_0V_RX.jpg

    Voltage pins MAX232...
    6

    07_st232_pino_02.jpg

    08_st232_pino_03.jpg

    09_st232_pino_04.jpg

    10_st232_pino_05.jpg

    11_st232_pino_06.jpg

    12_st232_pino_07.jpg

    13_st232_pino_08.jpg

    14_st232_pino_15.jpg

    15_st232_pino_16-10-9.jpg

    2 BC547 do circuito do max232...
    16_bc547_5V.jpg

    17_bc547_3,20V.jpg

    17_bc547_2,59V.jpg

    Voltage in ATMEGA8535...
    19_Atmega8535_GND.jpg

    20_Atmega8535_data.jpg

    21_Atmega8535_VCC-reset-MISO-SS-AVCC.jpg

    22_Atmega8535_MOSI-SCK.jpg

    23_Atmega8535_AREF.jpg

    Bridge programming...
    24_point_prog_GND.jpg

    25_point_prog_reset.jpg

    26_point_prog_SCK.jpg

    27_point_prog_MOSO.jpg

    28_point_prog_MOSI.jpg

    BC547 da ponte de programação...
    29_BC547_prog_C.jpg

    30_BC547_prog_B.jpg

    31_BC547_prog_E.jpg

    Resistors in the bridge program...
    32_resistor_4K7.jpg

    33_resistor_10K.jpg

    Voltage on pins serial port (DB9)...
    34_DB9_p3.jpg

    35_DB9_p4.jpg

    36_DB9_p5.jpg

    37_DB9_p6-7.jpg

    38_DB9_p8.jpg

    Now I'll do more tests and keep you informed of my progress.
    Thank you all.
    Everton

    Attached Files:

  8. R-eng

    R-eng Member

    Joined:
    Aug 4, 2008
    Messages:
    141
    Location:
    San Diego, CA, USA
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    just a silly thought; you certain that the KP DIP-Sw-2 was in the [OFF] position when you attempted to program?
  9. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hi R-eng, :hi:

    Yes, KP DIP-sw-2 was in the [OFF]. I prepared the voltages on the DIP for you take a look. :yes:

    39_Sw1 e Sw3.jpg

    40_Sw2 e Sw4.jpg

    41_ponto comum.jpg

    Regards
    Everton
  10. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello Friends, :yippiee:

    SUCCESS! Got! I could program the firmware on the ATMEGA8535. :clap: :lol: :rofl:

    Observing that the rafael_design said about USB cables I decided to test my serial cable. I was surprised but the serial cable was all reversed, pin 3 was the 8 pin, 2 pin 5, that is a mess. Got an internal serial cable from an old PC and plug directly into the motherboard. Thanks rafael_desig. :thbup:

    42_COMB.jpg

    43_COMB_PC.jpg

    Many thanks for the tips pippo978, rafael_design, R-eng, and special thanks to Thanos (TronicGr) for the design and images used here in the forum. :cheers: :highfive:

    I won a battle but I think the war will be long, hehe. :eek:
    Now the next problem is that the program within the ATMEGA8535 not get, is a black square on the display.
    I can program, read and write it, but will not start. I believe the ATMEGA8535 must have damaged so many tests.
    I bought one but ATMEGA8535 and I hope he gets here at home by mail, to continue my long awaited project.

    Regards
    Everton
  11. rafael_design

    rafael_design Member

    Joined:
    Feb 17, 2011
    Messages:
    202
    Occupation:
    CGI Architectural Visualizations with Blender 3D
    Location:
    Brasil
    Balance:
    328Coins
    Ratings:
    +19 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hi Everton,
    Nice to hear that you are having success! About the black square, in my case, it was just the lcd connection but things works anyway. In fact I had the black square when started to test H-bridge with the pots and motors.
    So, maybe if you test the amc/hb together you will find out!

    regards!
  12. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello Developers, I still need help. :sos:

    Build the H bridge but that did not have any effect, my problem with the display continues to show only black squares and not start the program. I do not know what to do. Please if anyone has any ideas. :eek:

    programaok.jpg

    quadrados copy.jpg

    Regards
    Everton
  13. R-eng

    R-eng Member

    Joined:
    Aug 4, 2008
    Messages:
    141
    Location:
    San Diego, CA, USA
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    A few suggestions. If this latest picture is the way you attempted to program the AMC, then I see a problem. All of your DIP switches are set to the on position. This means the KP is set to on, and then you cannot program the ATmega that way. The KP must be off. See pic with the yellow arrow.

    Also, if you have chosen to program using a different Xtal from your final choice, let's say 4Mhz, then you must change your Xtal and dual capacitors to the target values after programming. And in your case, I would not exceed 18.432Mhz because you are using the 16Mhz ATmega chip.

    Before you program the ATmega with Ponyprog, scroll to the bottom of the hex file and observe that the Xtal value is matching what you are using in the end. See my pic with the red circle.

    You can verify the CRC code before and after writing with Ponyprog by doing a read on the chip.

    Absolutely make sure your fuses are set correctly prior to writing to your chip!

    I have reprogrammed the same ATmega between 50-60 times with never a problem, other than brain fade setting mistakes.

    Follow procedures precisely and all should be fine. Make sure KP is off, jumper wires removed, Xtal reset if needed, and serial cable set to Prog connector prior to communicating with X-sim.

    cap-11.png

    cap-10.png
  14. R-eng

    R-eng Member

    Joined:
    Aug 4, 2008
    Messages:
    141
    Location:
    San Diego, CA, USA
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    Here is a little tool I use to test the outputs of the AMC without the use of a volt meter, LCD, or H-bridge. Very simple to make on a perfboard or even glued to a small piece of cardboard.

    Hope some will find this useful...works for me!

    R-eng

    AMC motor1-2 tester.png
  15. reese

    reese New Member

    Joined:
    Apr 11, 2011
    Messages:
    4
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    hi,tonquites
    Sorry,My English is very poor and had the help of Google Translate.
    AMC build process, I also happened this things.Since there is no DB9 Interface on my PC ,I used USB to DB9 and Programming is slow. When the program succesful, I unplug the power lead 8535 lock.
    Unlock and when program again i asleep and its OK....
    These are all nonsense ,Sorry.
    My means, you do wait until the programming light went out.
    I also being built H-bridge now and It does not work.
    I use a small motor 5V, and now I do not know with IRFZ44 or IRLZ44.....
  16. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello friend R-eng, :hi:

    Thanks for the tips, I'll consider all suggestions.

    - When I program, all DIP switches are off.
    DIPswitches.jpg


    - I am using Crystal 18,432 MHz and 22 pF capacitors for programming.
    cristal_cap.jpg

    - The firmware version is PWM_AMC15_2DOF_V1_CRYSTAL18.HEX
    18.jpg

    - I cleaned the ATMEGA8535
    erase.jpg

    - I programmed it again
    white.jpg

    - I read what was written
    read.jpg

    I checked everything again, no cold solder the tracks are good.

    -In the tests with the LED display goes black squares
    test_led.jpg

    I made a video where I put the potentiometer, disconnect the wires from the DB9 programming and place the dip 1 on, see the result:
    http://www.youtube.com/watch?v=t8yQERRHf0o

    I do not know what else to do ... :thbd: :? :eek:


    Thank you for your help
    Everton
  17. fermevc

    fermevc Member

    Joined:
    Jun 16, 2009
    Messages:
    126
    Occupation:
    Networking and telecomunication
    Location:
    Serbia
    Balance:
    5,956Coins
    Ratings:
    +55 / 0 / -0
    I think that your LCD is missing some connections.
    I've had similar problem, and if you could let us see your LCD wiring (best if you have exact LCD part number or datasheet) someone will help you solve this.
    In my case, it was R/W pin, I didn't connect it to GND.

    BR, Igor
  18. R-eng

    R-eng Member

    Joined:
    Aug 4, 2008
    Messages:
    141
    Location:
    San Diego, CA, USA
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    Right off the bat I can tell that the ATmega is programmed correctly! Otherwise those LEDs would not function as in the video. Your problem is elsewhere and I suspect the LCD unit.

    Make absolutely sure you have all wires configured correctly at the connector for the LCD as per;
    tronic-s-amc-motor-motion-controller-with-pwm-servo-output-t559-360.html

    Check especially your RS and E lines.

    Make sure you use any 2x16 parallel LCD that has HD44780 controller, or compatible. You are almost there.

    And double check the capacitor values as specified by the Xtal manufacturer.

    --------------------------------------
    Try this without worrying about the LCD.

    Now, get another pot and connect it up to FBch2. Set both of them to the brake point where both LED pairs are lit. Connect to the PC via X-sim sender/profiler with an appropriate profile loaded, and run the game, such as rFactor. You should be able to watch the LEDs light up indicating accel/decel and left/right turns (if those are your chosen inputs) as the game runs.

    R-eng
  19. tonquites

    tonquites Member

    Joined:
    Jul 24, 2009
    Messages:
    41
    Location:
    Joinville, Brasil
    Balance:
    280Coins
    Ratings:
    +0 / 0 / -0
    Hello Friends, thank you :hi:

    I did a color scheme to show the connections to the LCD.

    sistema_cores.jpg

    The resistor I'm using the LCD is 10 ohms, according the scheme of Thanos.

    Here is the datasheet of the display.
    MGD1602B-FL-YBS.pdf

    It is possible that the LCD is damaged? :eek:
    -----------------------------------------------

    R-eng, I did not understand what I do now. :?
    What is FBch2?

    Regards
    Everton
  20. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Connect the R/W pin (between E and RS) to ground if it is not soldered there. You have to be in Write mode to display anything on the LCD.