Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - AndThen

61
Client software / Re: Failed to open COM port on windows 7
The changes between ports are what happens when a device resets faster than windows can remove the prior device. If it's randomly hopping ports It is likely being reset(brown out maybe). For manual resets it is helpful to have the device manager open so you see when to release the switch.

I know it is windows but you really shouldn't need a computer restart. If you close the client and disconnect the OLS does the device/port remove it's self?
62
Pirate PIC programmer / Re: PATCH: flash size fixes(?) pic24
Just a quick FYI follow-up. The PIC18 Issues I mention were indeed hardware, it's USB regulator is malfunctioning. I haven't decided if I want to cut the chip off and replace it or add an external regulator
63
Pirate PIC programmer / Another programmer
These are already out of date, full of errors, steals candy from children, kicks your dog ect...

Now with that disclaimer out of the way, I'm going to attach two patches for "insurance" purposes.

The first:
Is the "least intrusive" version, there are two known issues in this patch
1: There shouldn't be ANY changes in pic.c. You can replace/revert it from the svn repo
2: The related changes in main.c to MEM_Init calls
This patch includes:
Parallax BS2 Firmware with support for pic18(416 mode), pic24 (424 mode), and four-wire pic32
-L(ist) option from the USBASP patches
The few "fixes" for serial port, and maybe some random I don't remember.
[attachment=2]

The second:
Is my complete development branch in all it's glorious randomness...
This includes a 4 wire pic32.c, along with I don't recall what else. So I attach the Changelog from cvs commits.
[attachment=1]
[attachment=0]

I don't have a schematic drawn up sorry
MCLR is pulled low via an NPN
VPP is switched via NPN-PNP from the wall wart
5v to 3v3 Conversion is thru a TXB0104

2-wire connections:
 15 -> Data
 14 -> Clock
 11 -> MCLR
4-wire connections: (These are confused/ing sorry)
 15 -> TDI(to target)
 14 -> TCK
 13 -> TDO (from target)
 12 -> TMS
 11 -> MCLR
65
Project development, ideas, and suggestions / Re: check gas (GPL) tank capacity
Quote
You need to understand that LPG is liquid gas and the pressure is almost constant in the tank. Using pressure sensor won't work, until the tank is empty :-)

Oh nice catch. A standard PSI reading will require computation. There are gauges available for off the shelf solutions, "Gaswatch, Camco, and Mr Bar-B-Que..."

Since this isn't metering rockets or life support, close is good enough no?  New(cheap?) BBQ regulators emit an audible noise when the tanks get low. At which point you have 3-0 grillings left depending on the cook and weather/locale. In the case you have a nice regulator you will/can see the tank pressure change on a gauge.

Indeed, large residential tanks here use a float gauge iirc. Also I think the RV shops have a sticker type gauge now that works on temperature difference.

I should probably mention it hasn't been legal to use a pressure gauge on RV tanks for at least 30 years, and it's been almost that long since I've been to an Rv supply house, and the gauges my father used were some "LP safe" sealed fluid filled type. But I'd hate to imagine old men are still having to heft tanks on spring scales.

Anyways, I use the noisy regulator method. If i was deaf to that I guess a counter balance with a flag or scale would be the simple solution.  I still have available refill stations, the farmers co-op and a KOA both have large tanks, despite "Evil mega corp"'s attempts to put exchange stations everywhere.

A sonic implementation is very cool and geek-ish!  But it is complicated by the tank exchange system. Do you ping up and sense thru the fluid for the surface? Ping the can and gauge the dampening effect?  How to account for container variation? Do you really want to put electronics against explosives?

*PS Yeah I typed it all out I'm going to submit it even if The between posts covered it all
66
Project development, ideas, and suggestions / Re: check gas (GPL) tank capacity
If you use a spring type scale, there maybe issues with accuracy over time. However a balance/beam type scale there is no issue.

Dependent on the construction of the tank, you'll need to find either a standalone or inline pressure gauge. Mechanical gauges are usually very accurate, unless the label isn't glued down properly and rotates.

It just "sunk in" you exchange tanks, so an inline type pressure gauge would be required.
68
Bus Pirate Support / Re: demonstration of UART on Android
Pretty sure the "enter" was on the debug terminal controlled by u-boot, it's a bit hard to follow the output at that speed but there was a prompt I think.  To be clear you press enter on the PC connected to the bus pirate terminal program.
69
Pirate PIC programmer / Re: PATCH: flash size fixes(?) pic24
Quote
Could you also change the "EEPROM" to "FUSE" ? it seems that I did some error, and it got copied multiple times.

You did it intentionally for special handling of the config when it is contained in the other section. Due to fixed page size, there are anomaly in the output HEX, if you read only the config area it outputs the rest of the area as blank memory.  I'm using a check  against the last read address and the fuse base, currently to test if it has been read already.

EEPROM to FUSE change requires a test in the PIC_ReadMemory. And the FLASH area size needs to include the FUSE area in those cases where it overlaps, do not subtract it.

---
issue: BP_PIC424Read(), When called from the PIC_ReadMemory/PIC24_Read it is asked to read a byte count, but returns six times as much data as requested.
---
issue: PIC24_Read(), When called from the PIC24_ReadID it is asked to read as iteration, it should be a byte count. 8 bytes, or 2 words, not 1 "block"
---
issue: BP_PIC424Read(), Does not properly unpack data. Output has no padding inserted. Output should be MSB and LSW
---
issue: PIC24_ReadID(), Ug and uh uhm, ya. All of the above.
---
issue: PIC24_Read(), addr when called from the PIC_ReadMemory() needs to be converted to a word address, divided by 2.
---
issue: PIC24 page_size, The current implementation of PIC24_Write requires this to be 256 bytes(0x100) or 64 32bit words, this is in fact the write/row size, the actual erase/page size is 2kb.
---
issue:  Flash sizes, for the 24FJ64GA002 (Bus pirate 3.5) size = 86*1024

***
pic24:
I've completed a write read test of the bpv3-BL44FW510-DUMP.hex, the read back is almost exact it only differs on the configuration words. The input has them as two single records(08), the output has them in a single block(10).

pic18:
I should do the full pic18 HV read write tests again maybe.
LV the stamp interface is too slow to toggle the lines and there is no room for another firmware command.

My hack attempt to write only the bootloader doesn't appear to have worked this time. I want to blame the new hardware since it has different parasites and no crystal capacitors.


pic32:
pic32 is still a four wire implementation.
TMS needs reconciled to a buspirate line. VPPHigh and VPPLow can probably be used, but I added/have an LVP line (intended for controlling the PGM line on pic18) assigned to TMS currently.

I forget the exact state of the read/write tests, I "think" they are/were pass. I was distracted by the pickit2..
Pickit2 PC-App source can be adjusted to load the PE, but again I forget the exact status, (from memory) erase works, read works, word write probably does not work, and block programming definitely does not.

***
I can provide only sloppy patches currently, since I was doing clean up and verification when the pic24 stuff appeared it is ugly again.  Oh and also the long device list will need recreation without the subtractions, and my Changelog is out of date.
70
General discussion / Re: Murphy's ruined my weekends
Hot air reflow might be ok for smaller headers.

Unless they are true captive pins, the least destructive and rapid method is to pry the shroud off the pins and remove them one at a time. The pins will almost fall right out without the shroud and then be reinserted from the bottom of the shroud once cooled.

If you have other shrouded connectors or just don't care about the damage, use lots of heat. Don't hold the pin until it starts to flop around loosely and then spin it with your pliers. Essentially they need to be hot enough to pull thru the plastic with out cooling.
Needless to say they don't always like to back together after this treatment.
71
Project logs / Re: TMP006 BOB free build
Quote
Response to variations in temperature seems to be slower than a thought.

Page 11 has the configuration. (datasheet link above)
It will default to one second, the fastest conversion is only 4 samples per second with no averaging.  It's still fast enough to sniff out old school zombies that don't run, but you might have problems reading the children's temperatures =)
73
Pirate PIC programmer / Re: Added Support for USBASP in picprog
Tekaikko, You should be able post links soon, please can you provide the links for the datasheet discrepency?  I only managed to turn up one thread and it listed everything but programming spec. (http://www.microchip.com/forums/tm.aspx ... 79&mpage=1)

Below is the implementation I'm using, it might not be a "drop in" It was pulled out of it's project and cleaned up here in the forum editor so I may of missed something.. Seems most of the changes are BNE offsets, IIRC I had to fine tune these in the MPLAB simulator.
Code: [Select]

uint32_t NVMcommands[] = {
// Prime SRAM
//Step 1
  0x3c10A000 // Sram base //0
//Step 2
, 0x3c080000 // data H //1
, 0x35080000 // data L //2
, 0xAE080000 // offset (inc by 4) //3

// flash
//Step 1: Initialize some constants.
, 0x3c04bf80 //lui a0,0xbf80 //4
, 0x3484f400 //ori a0,a0,0xf400 //5
, 0x34050000 //ori a1,$0,0x4001 //6
, 0x34068000 //ori a2,$0,0x8000 //7
, 0x34074000 //ori a3,$0,0x4000 //8
, 0x3c11aa99 //lui s1,0xaa99 //9
, 0x36316655 //ori s1,s1,0x6655 //10
, 0x3c125566 //lui s2,0x5566 //11
, 0x365299aa //ori s2,s2,0x99aa //12
, 0x3c13ff20 //lui s3,0xff20 //13
, 0x3c100000 //lui s0,0x0000 //14
//Step 2: Set NVMADDR with the address
, 0x3c080000 //lui t0,<FLASH_ROW_ADDR(31:16)> //15
, 0x35080000 //ori t0,t0,<FLASH_ROW_ADDR(15:0)> //16
, 0xac880020 //sw t0,32(a0) //17
//Step 3: Set NVMSRCADDR with the physical source SRAM address.
, 0x36100000 // ori s0,s0,<RAM_ADDR(15:0)> //18
//Step 4: Set up NVMCON for write operation and poll LVDSTAT.
, 0xac850000 //sw a1,0(a0) //19
// delay (6 us)
//here1:
, 0x8C880000 //lw t0,0(a0) //20
, 0x31080800 //andit0,t0,0x0800 //21
//, 0x1500fffd //bne t0,$0,<here1> //22
, 0x1500fff4 //bne t0,$0,<here1> //22
, 0x00000000 //nop //23
//Step 5: Unlock NVMCON and start write operation.
, 0xac910010 //sw s1,16(a0) //24
, 0xac920010 //sw s2,16(a0) //25
, 0xac860008 //sw a2,8(a0) //26
//Step 6: Repeatedly read the NVMCON register and poll for WR bit to get cleared.
//here2:
, 0x8c880000 //lw t0,0(a0) //27
, 0x01064024 //and t0,t0,a2 //28
//, 0x1500fffd //bne t0,$0,<here2> //29
, 0x1500fff4 //bne t0,$0,<here2> //29
, 0x00000000 //nop //30
//Step 7: Wait at least 500 ns after seeing a 0 in NVMCON<15> before writing to any NVM registers. This requires inserting NOP in the execution.
, 0x00000000 //nop //31
, 0x00000000 //nop //32
, 0x00000000 //nop //33
, 0x00000000 //nop //34
//Step 8: Clear NVMCON.WREN bit.
, 0xac870004 //sw a3,4(a0) //35
//Step 9: Check the NVMCON.WRERR bit
, 0x8c880000 //lw t0,0(a0) //36
, 0x30082000 //andit0,zero,0x2000 //37
//, 0x1500ffdc //bne t0, $0, <err_proc_offset>//38
, 0x1500FF64 //bne t0, $0, <err_proc_offset>//38
, 0x00000000 //nop //39
};

void program_word (unsigned addr, unsigned word)
{
uint16_t addrH, addrL, dataH, dataL;
addrH = addr >> 16;
addrL = addr;
dataH = word >> 16;
dataL = word;

// if (debug_level > 0)
{
fprintf (stderr
, "stampit2: program word at %04x:%04x %04x:%04x n"
, addrH, addrL
, dataH, dataL
);
}
/* Without PE. */
uint16_t bufferOffset = 0;
uint16_t c = 0;

// ram buffer
fprintf(stderr, "stampIT2: ram buffern");
// : 0-3
xferinst(NVMcommands[0]);
xferinst(NVMcommands[1] | dataH);
xferinst(NVMcommands[2] | dataL);
xferinst(NVMcommands[3] | bufferOffset);
// flash write
fprintf(stderr, "stampIT2: flash write startn");
// Step1: 4-14 Init
xferinst(NVMcommands[4]);
xferinst(NVMcommands[5]);
uint32_t optype = 0x4001;//word write
//uint32_t optype = 0x4003;//row write 128 words
//uint32_t optype = 0x4004;//page erase
//uint32_t optype = 0x4005;//PFM erase
xferinst(NVMcommands[6] | optype);
for(c=7;c<=14;c++)
xferinst(NVMcommands[c]);
// Step2: 15-17
xferinst(NVMcommands[15] | addrH);
xferinst(NVMcommands[16] | addrL);
xferinst(NVMcommands[17]);
// Step3: 18
xferinst(NVMcommands[18] | bufferOffset);
// Step4: 19-23
xferinst(NVMcommands[19]);
usleep(600);
for(c=20;c<=23;c++)
xferinst(NVMcommands[c]);
// Step5: 24-26
for(c=24;c<=26;c++)
xferinst(NVMcommands[c]);
// Step6: 27-30
for(c=27;c<=30;c++)
xferinst(NVMcommands[c]);
// Step7: 31-34
for(c=31;c<=34;c++)
xferinst(NVMcommands[c]);
// Step8: 35
xferinst(NVMcommands[35]);
// Step9: 36-39
for(c=36;c<=39;c++)
xferinst(NVMcommands[c]);
fprintf(stderr, "stampIT2: flash write endn");
return;
}

/*
 * Flash write, 1-kbyte blocks.
 */
void program_block (unsigned addr, unsigned *data)
{
unsigned nwords = 256;
unsigned words_written;

// if (debug_level > 0)
fprintf (stderr, "stampIT2: program %d bytes at %08xn", nwords*4, addr);

uint16_t addrH, addrL, dataH, dataL;
addrH = addr >> 16;
addrL = addr;
/* Without PE. */

uint16_t c = 0;
// data = 1024 bytes, 256 words
// row = 128 words
uint8_t rowCur = 0,rowNeed = 2;
uint32_t dataOffset = 0, bufferOffset = 0;
for(;rowCur<rowNeed;rowCur++)
{
// ram buffer
fprintf(stderr, "stampIT2: ram buffern");
uint16_t wordCur = 0, wordNeed = 128;
dataOffset += bufferOffset;
uint32_t* row = data+dataOffset;
bufferOffset = 0;
uint32_t rowValid = 0;
for(wordCur=0;wordCur<wordNeed;wordCur++)
{
uint32_t word = *(row+bufferOffset);
//fprintf(stderr," %08x -> %08x <- %08xn",addr+dataOffset+bufferOffset,word,bufferOffset);
if(word!=0xFFFFFFFF)
{
rowValid += 1;
}
bufferOffset += 4;
}
if(!rowValid)
{
fprintf(stderr,"stampIT2: Skipping empty rown");
continue;
}
else {
fprintf(stderr, "stampIT2: row=%u words=%un",rowCur,rowValid);
}
bufferOffset = 0;
///////////
// TODO
// rowValid is a word count
// write small count as words not rows
///////////
uint32_t lastWord = 0;

xferinst(NVMcommands[0]); // Ram base

for(wordCur=0;wordCur<wordNeed;wordCur++)
{
uint32_t word = *(row+bufferOffset);
dataH = word >> 16;
dataL = word;
if(wordCur==0 || word != lastWord)
{ // Already buffered only need cmd3
    xferinst(NVMcommands[1] | dataH);
    xferinst(NVMcommands[2] | dataL);
}
fprintf(stderr," %08x -> %08x <- %08xn",addr+dataOffset+bufferOffset,word,bufferOffset);
lastWord = word;
xferinst(NVMcommands[3] | bufferOffset);
bufferOffset = bufferOffset + 4;
}
// flash write
fprintf(stderr, "stampIT2: flash write startn");
// Step1: 4-14 Init
xferinst(NVMcommands[4]);
xferinst(NVMcommands[5]);
//uint32_t optype = 0x4001;//word write
uint32_t optype = 0x4003;//row write 128 words
//uint32_t optype = 0x4004;//page erase
//uint32_t optype = 0x4005;//PFM erase
xferinst(NVMcommands[6] | optype);
for(c=7;c<=14;c++)
xferinst(NVMcommands[c]);
// Step2: 15-17
xferinst(NVMcommands[15] | addrH);
xferinst(NVMcommands[16] | addrL);
xferinst(NVMcommands[17]);
// Step3: 18
xferinst(NVMcommands[18] | bufferOffset);
// Step4: 19-23
xferinst(NVMcommands[19]);
usleep(600);
for(c=20;c<=23;c++)
xferinst(NVMcommands[c]);
// Step5: 24-26
for(c=24;c<=26;c++)
xferinst(NVMcommands[c]);
// Step6: 27-30
for(c=27;c<=30;c++)
xferinst(NVMcommands[c]);
// Step7: 31-34
for(c=31;c<=34;c++)
xferinst(NVMcommands[c]);
// Step8: 35
xferinst(NVMcommands[35]);
// Step9: 36-39
for(c=36;c<=39;c++)
xferinst(NVMcommands[c]);
}

fprintf(stderr, "stampIT2: flash write endn");
return;
}


Regarding the PE I haven't got around to pulling it apart, I expect there are multiple hard coded addresses and sizes. The word program might function correctly without modifications, but the row/page functions are the wrong sizes.
  I had some issues getting the PE to load, turned out I followed a bad example of someone who followed mchp bad example, the datasheet gives correct procedure to setup BMX Pickit and copies are likely hardcoded to 32k.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01612501016session_write_close ( )...(null):0
20.01642632632ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01642633408Database_MySQL->query( ).../DatabaseHandler.php:119
40.06122772168Database_MySQL->error( ).../Db-mysql.class.php:273