Go Back   EcoModder Forum > EcoModding > Fossil Fuel Free
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 03-07-2015, 10:20 AM   #1751 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
OK, let's try a different hex file. I just emailed it to you. The one I sent to you before had been untested, and I had messed with the serial a bit. I just commented out the new part, and changed it to 38.4kbps 8N1. I need to get that AC controller tested. I've been so busy this week! man oh man. Maybe I can do it this morning.

-Paul

__________________
kits and boards
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 03-07-2015, 02:17 PM   #1752 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by thingstodo View Post
I think I had the 'erase before programming' checkbox checked .. but I'll do the explicit erase, then reprogram. That's step 1.

I'll report back tomorrow.
Step 1

The log file is below copied from MPLAB IPE v2.30

My comments begin with //

************************************************** ***

Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.32.09 *
Firmware type..............dsPIC30F

Target voltage detected
Target device dsPIC30F4011 found.
Device ID Revision = 1004

// press the button labeled Blank Check

2015-03-07T12:28:29-0600- Blank checking...

Blank Checking...
program memory
Address: 0 Expected Value: ffffff Received Value: 40100
Blank check complete, device is not blank.
2015-03-07T12:28:31-0600- Blank check failed

// so there IS something programmed in the dsPIC
// so erase it and start again - press Erase button

2015-03-07T12:28:41-0600- Erasing...

Erasing...
Erase successful
2015-03-07T12:28:43-0600- Erase device complete

// load in ACControllerProject.hex file

2015-03-07T12:29:37-0600- Loading hex file. Please wait...
Loading code from C:\Users\lulcm\Downloads\ACControllerProject.hex.. .
2015-03-07T12:29:38-0600- Hex file loaded successfully.

// Press Program button

2015-03-07T12:29:44-0600- Programming...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x2fff
configuration memory

Device Erased...

// I thought I had that erase before programming box checked ..

Programming...
Programming/Verify complete
2015-03-07T12:29:54-0600- Programming complete
Pass Count: 1

// looks like it worked. Verify it.

2015-03-07T12:32:26-0600- Verifying...

Verifying...
User Id Memory
Address: 8005c2 Expected Value: ffff Received Value: ffffff
Verify failed
2015-03-07T12:32:41-0600- Verify failed

// OK - the program does not verify after the program/verify ran .. ?
// Erase again, repeat the process

2015-03-07T12:33:04-0600- Erasing...

Erasing...
Erase successful
2015-03-07T12:33:08-0600- Erase device complete

// This time we blank check before programming using the Blank Check button
2015-03-07T12:33:58-0600- Blank checking...

Blank Checking...
Blank check complete, device is blank.
2015-03-07T12:34:06-0600- Device is blank

// Excellent - it's blank
// Now program it

2015-03-07T12:34:48-0600- Programming...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x2fff
configuration memory

Device Erased...
// Oh - should have removed the erase before programming box

Programming...
Programming/Verify complete
2015-03-07T12:34:57-0600- Programming complete
Pass Count: 2

// For the second time, programming/verify is complete and has passed
// and NOT failed

// Now to verify it

2015-03-07T12:36:11-0600- Verifying...

Verifying...
User Id Memory
Address: 8005c2 Expected Value: ffff Received Value: ffffff
Verify failed
2015-03-07T12:36:24-0600- Verify failed

************************************************** ***

Not sure if this value is important - not all parts of the chip were programmed.

Program memory appears to be 0x0 - 0x7FFF
Not sure what is at address 0x8005C2 but I'm hesitant to mess with the
PICkit 3 programming setup.

Serial cable 1 still gives me gibberish on the screen at 115K
and still echoes back everything at 9600 baud

Serial cable 2 does nothing. I suspect that I pulled out the pin for tx or rx
when I was soldering. I'll rebuild that with another 3 pin header

If that doesn't work - off to step 2. Install 8.83
  Reply With Quote
The Following User Says Thank You to thingstodo For This Useful Post:
MPaulHolmes (03-07-2015)
Old 03-07-2015, 02:37 PM   #1753 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
I occasionally had trouble programming the microcontroller when I used the extra cable. It would sometimes only work if I plugged the pickit3 directly into the 6 pins on the board. To do that you would have to remove the enclosure. Make sure you use the new hex file I sent earlier today. I changed the speed to 38.4kbps and 8N1.
__________________
kits and boards
  Reply With Quote
Old 03-07-2015, 03:44 PM   #1754 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Because it was easier, I used the extension cable on the ICSP to load the hex file in. I don't think the programmer is the problem. There are no errors logged .. which I would expect if there were a problem. The verify appears to be looking at a much wider address space than the program?

This is still with MPLAB X (actually, MPLAB IPE version 2.30 is what loads the hex file and send it to the board via PICkit 3)

The log shows the same error on verify, at the same memory location (not sure what that memory is used for, but it's not in program space)

38,400 baud, no parity, 8 data bits, 1 stop bit - no response on serial. I built a new serial cable. No continuity between the pins on the 3 pin header - so no short circuits with solder or anything else.

Log is below. Looks very close to the last log.

Moving to step 2 - install MPLAB 8.83


************************************************** ***

Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.32.09 *
Firmware type..............dsPIC30F

Target voltage detected
Target device dsPIC30F4011 found.
Device ID Revision = 1004
2015-03-07T14:30:59-0600- Erasing...

Erasing...
Erase successful
2015-03-07T14:31:02-0600- Erase device complete

2015-03-07T14:31:05-0600- Blank checking...

Blank Checking...
Blank check complete, device is blank.
2015-03-07T14:31:14-0600- Device is blank

2015-03-07T14:31:22-0600- Programming...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x2dff
configuration memory

Device Erased...

Programming...
Programming/Verify complete
2015-03-07T14:31:32-0600- Programming complete
Pass Count: 3

2015-03-07T14:35:27-0600- Verifying...

Verifying...
User Id Memory
Address: 8005c2 Expected Value: ffff Received Value: ffffff
Verify failed
2015-03-07T14:35:40-0600- Verify failed

Target removed

PICkit 3 removed

************************************************** ***
  Reply With Quote
Old 03-07-2015, 04:59 PM   #1755 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by thingstodo View Post
I found 8.83 in the mplab archive and downloaded the zip file. If the erase does not help, I'll try using 8.83. That's step 2. Do you have the version of the compiler you are using? (just in case that makes a difference somewhere down the line) Are there versions for the libraries?
Loaded 8.83 and it loaded a C compiler as well. Maybe I don't need to know the version of the C compiler and other tools if they load auto-magically.

Log from 8.83, // shows my comments

*************************************************
// import hex file from this morning's email

PICkit 3 detected
Connecting to PICkit 3...
Running self test...
Self test completed
Firmware Suite Version...... 01.32.09
Firmware type......................dsPIC30F
PICkit 3 Connected.
Target Detected
Device ID Revision = 00001004

// Click erase
Erasing...
Erase device complete

// Click blank check
Blank Checking...
Device is blank

// click program
Programming...
Programming/Verify complete

// click verify
Verifying...
Verify complete

************************************************** *

Cycle power, connect at 38,40, no parity, 8 data bits, 1 stop bit

No response.
  Reply With Quote
Old 03-07-2015, 05:26 PM   #1756 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Serial cables

Cable 1 (modified)
Pin 5 on rs232 (9 pin) is yellow - gnd on right of control board
Pin 3 on rs232 (9 pin) is red - RX in middle of control board
Pin 2 on rs232 (9 pin) is brown - TX on left of control board

Cable 2
Pin 5 on rs232 (9 pin) is black - gnd on right of control board
pin 2 on rs232 (9 pin) is white - RX in middle of control board
pin 3 on rs232 (9 pin) is red - TX on left of control board

These are set up to function as a null modem if I connect them together through a 3 pin male - male header. But they also try the control board both ways for TX and RX.

2 laptops running hyperterminal at 38,400 n 8 1 with no handshaking display properly on the opposite screens. That is - type on newer laptop and it shows on older laptop display. Type on older laptop and it shows up on newer laptop display.

Using my main laptop (not leviathon) windows 7 - and a recent USB to serial adapter, and cable 1, type may returns to the controller. No response. The serial converter has an LED for tx (green) and an LED for rx (yellow). No yellow LED lit for rx.

Cycle power to the controller with hyperterminal already connected and online. No echo, no response. Check at 9600 ... for no reason. No response.

Remove the PICkit 3 and try again at 38400. No response.

Check that it still works with the other laptop at 38,400. Yes.

Check cable 2 - same test.

Again, green LED shows transmit but no yellow LED for rx.

Again, verify that the two laptops still talk at 38400, one cable on each with a 3 pin male - male header between. Yes.

I think with all of the messing around I did that I blew up the serial port on the control board.

If anyone can think of something else for me to try - please do!
  Reply With Quote
Old 03-07-2015, 05:39 PM   #1757 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
I tried CR/LF instead of just CR

I tried LF instead of CR

No change. On either of the 2 cables.

Then when switching cables I accidentally put the serial cable onto the header backward. Ground on the left. And I got local echo!

No status from the controller on return, or CR/LF, or LF ... but it echoed all of my characters.

So I did the same thing with the other cable. Umm .. same result?

Hyperterminal comes up with a terminal emulator of VT100 for me (likely because of some setting somewhere). Could that be affecting something?

Does using TX as GND make for some interesting voltage reference issues on the GND pin?

I think that the times when I saw jibberish on the screen with the older hex file that I may have had the header on the controller installed backward. When either cable is installed correctly now - there has never been a local echo, or the status line that the controller should be putting out.
  Reply With Quote
Old 03-08-2015, 01:02 AM   #1758 (permalink)
Permanent Apprentice
 
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 314 Times in 215 Posts
This won't really help thingtodo's problems;

I have the same talent for hooking stuff up backwards. For that reason I'm pretty paranoid about making this nearly impossible by design.

I was looking at my old MPLAB ICD2, and they used a cat5 cable between the demo board and the debugger. For all the different little programs I've written for that demo-board I never managed to hook that up backwards - LOL!

Perhaps it would be possible to make some mod for the new control boards for a keyed programmer connection?

Good Luck, thingstodo! You are really helping us all out by posting this. I truly appreciate it.

- e*clipse
  Reply With Quote
Old 03-09-2015, 08:05 AM   #1759 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
thingstodo is coming down to Phoenix, so we'll get to the bottom of it! I also have my solder sucker ready to go if we need to swap out the serial chip.
__________________
kits and boards
  Reply With Quote
Old 03-09-2015, 08:03 PM   #1760 (permalink)
Dreamer
 
Join Date: Nov 2013
Location: Australia
Posts: 350
Thanks: 95
Thanked 214 Times in 151 Posts
Quote:
Originally Posted by MPaulHolmes View Post
thingstodo is coming down to Phoenix, so we'll get to the bottom of it! I also have my solder sucker ready to go if we need to swap out the serial chip.
Whoohoo... road trip.

Actually that is quite a road trip, i am guessing thingstodo will be flying?

I have done road trips that long and although fun. Afterwards you definitely feel that seeing as you have driven it once the next time flying is totally allowed.

  Reply With Quote
Reply  Post New Thread




Similar Threads
Thread Thread Starter Forum Replies Last Post
Paul & Sabrina's cheap DIY 144v motor controller MPaulHolmes Open ReVolt: open source DC motor controller 7381 08-02-2023 10:55 PM
Paul & Sabrina's Cheap EV Conversion MPaulHolmes Fossil Fuel Free 542 11-12-2016 09:09 PM
Contest! Name Paul & Sabrina's controller MetroMPG Forum News & Feedback 120 10-22-2011 01:59 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com